Commit b2d0a191 authored by zengtianlai3's avatar zengtianlai3

Merge branch 'm33' into 'master'

集成Knif4j

See merge request !23
parents 9fabaa02 035f9501
......@@ -83,6 +83,13 @@
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!--Knife4j API文档生产工具-->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.9</version>
</dependency>
</dependencies>
<build>
......
......@@ -5,13 +5,21 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ServletComponentScan(basePackages ="iot.sixiang.license")
@SpringBootApplication
@EnableScheduling
@MapperScan(basePackages = "iot.sixiang.license.mapper")
public class LicenseApplication {
public class LicenseApplication implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
public static void main(String[] args) {
SpringApplication.run(LicenseApplication.class, args);
......
package iot.sixiang.license.config;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
/**
* Created by m33 on 2022/6/13 20:04
*/
@Configuration
@EnableSwagger2WebMvc
@EnableKnife4j
//@Import(BeanValidatorPluginsConfiguration.class)
public class Knife4jConfig {
@Bean
public Docket docket() {
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(new ApiInfoBuilder()
.description("实名制服务器接口文档")
.termsOfServiceUrl("http://web.license.srthinker.com/")
.version("1.0")
.build())
//分组名称
.groupName("iot_license")
.select()
//这里指定Controller扫描包路径
.apis(RequestHandlerSelectors.basePackage("iot.sixiang.license.controller"))
.paths(PathSelectors.any())
.build();
return docket;
}
}
package iot.sixiang.license.controller;
import iot.sixiang.license.jwt.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.jwt.UserUtils;
import iot.sixiang.license.model.ResResult;
import iot.sixiang.license.model.vo.AlarmVo;
import iot.sixiang.license.service.AlarmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
......@@ -21,18 +24,18 @@ import java.util.List;
*/
@RestController
@RequestMapping("/iot_license/alarm")
@Api(value = "告警模块", tags = {"告警模块"})
public class AlarmController {
@Autowired
private AlarmService alarmService;
@ApiOperation(value = "获取告警列表接口", notes = "用于获取告警列表")
@GetMapping("list")
public ResResult getAlarmList() {
String userId = UserUtils.getLoginUserId();
int Id = Integer.valueOf(userId);
List<AlarmVo> alarmList = alarmService.getAlarmList(Id);
return ResResult.success().record(alarmList);
}
}
}
\ No newline at end of file
package iot.sixiang.license.controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.model.BaseResult;
import iot.sixiang.license.service.AlarmReadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -20,11 +20,13 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("/iot_license/alarm_read")
@Api(value = "告警已读模块", tags = {"告警已读模块"})
public class AlarmReadController {
@Autowired
private AlarmReadService alarmReadService;
@ApiOperation(value = "告警已读接口", notes = "将告警信息状态设为已读")
@PostMapping("read")
public BaseResult readAlarm(){
// int userId = jsonObject.getIntValue("userId");
......
......@@ -2,6 +2,13 @@ package iot.sixiang.license.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.model.BaseResult;
import iot.sixiang.license.model.PageInfoModel;
import iot.sixiang.license.model.PageResult;
......@@ -22,6 +29,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/iot_license/apply")
@Api(value = "应用模块", tags = {"应用模块"})
public class ApplyController {
@Autowired
......@@ -32,7 +40,13 @@ public class ApplyController {
* @param jsonObject
* @return
*/
@ApiOperation(value = "应用添加接口", notes = "用于添加应用")
@PostMapping("add")
@ApiOperationSupport(params = @DynamicParameters(name = "jsonObject",properties = {
@DynamicParameter(name = "appName",value = "应用名",required = true,dataTypeClass = String.class),
@DynamicParameter(name = "appKey",value = "应用key",required = true,dataTypeClass = String.class),
@DynamicParameter(name = "userId",value = "用户Id",required = true,dataTypeClass = Integer.class)
}))
public BaseResult addUser(@RequestBody JSONObject jsonObject) {
String appName = jsonObject.getString("appName");
String appKey = jsonObject.getString("appKey");
......@@ -51,7 +65,13 @@ public class ApplyController {
* @param pageSize
* @return
*/
@ApiOperation(value = "获取应用列表接口", notes = "用于获取应用列表")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name = "当前页",value = "当前在第几页", required = true),
@ApiImplicitParam(name = "每页数量",value = "每页显示多少页", required = true),
@ApiImplicitParam(name = "应用名",value = "应用名", required = false)
})
public PageResult getUserList(@RequestParam(value = "pageNo", defaultValue = "0") int pageNo, @RequestParam(value = "pageSize", defaultValue = "0") int pageSize,
@RequestParam(value = "appName",required = false) String appName) {
PageInfoModel<AppVo> records = applyService.getAppList(pageNo,pageSize,appName);
......
......@@ -2,6 +2,11 @@ package iot.sixiang.license.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.model.BaseResult;
import iot.sixiang.license.model.PageInfoModel;
import iot.sixiang.license.model.PageResult;
......@@ -22,6 +27,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/iot_license/device")
@Api(value = "设备模块", tags = {"设备模块"})
public class DeviceController {
@Autowired
......@@ -32,7 +38,12 @@ public class DeviceController {
* @param jsonObject
* @return
*/
@ApiOperation(value = "添加设备接口", notes = "用于添加设备")
@PostMapping("add")
@ApiOperationSupport(params = @DynamicParameters(name = "jsonObject",properties = {
@DynamicParameter(name = "appId",value = "应用Id",required = true,dataTypeClass = Integer.class),
@DynamicParameter(name = "count",value = "需要创建的设备数量",required = true,dataTypeClass = Integer.class),
}))
public BaseResult addDevice(@RequestBody JSONObject jsonObject) {
int appId = jsonObject.getIntValue("appId");
int count = jsonObject.getIntValue("count");
......@@ -52,6 +63,7 @@ public class DeviceController {
* @param userName
* @return
*/
@ApiOperation(value = "获取设备列表接口", notes = "用于获取设备列表")
@GetMapping("list")
public PageResult getDeviceList(@RequestParam(value = "pageNo", defaultValue = "0") int pageNo,
@RequestParam(value = "pageSize", defaultValue = "0") int pageSize,
......
package iot.sixiang.license.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.jwt.JwtUtil;
import iot.sixiang.license.jwt.LoginUser;
import iot.sixiang.license.jwt.UserUtils;
import iot.sixiang.license.model.ResResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -19,6 +20,7 @@ import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/")
@Api(value = "登录模块", tags = {"登录模块"})
public class LoginController {
//模拟数据库
......@@ -32,7 +34,7 @@ public class LoginController {
/**
* 模拟用户登录
*/
@ApiOperation(value = "登录接口", notes = "登录接口")
@GetMapping("login")
public ResResult login(@RequestParam("userName") String userName, @RequestParam("password") String password) {
......@@ -50,6 +52,7 @@ public class LoginController {
return ResResult.fail().msg("用户名或密码错误");
}
@ApiOperation(value = "注销接口", notes = "注销接口")
@GetMapping("logout")
public ResResult logout(@RequestParam("userName") String userName, @RequestParam("password") String password) {
// @RequestBody JSONObject jsonObject
......
package iot.sixiang.license.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.model.ResResult;
import iot.sixiang.license.model.SamMonitor;
import iot.sixiang.license.operate.OperateManager;
......@@ -14,6 +16,7 @@ import java.util.List;
@Slf4j
@RestController
@RequestMapping("/iot_license/operate")
@Api(value = "运维模块", tags = {"运维模块"})
public class OperateController {
@Autowired
......@@ -21,6 +24,7 @@ public class OperateController {
@Autowired
private MonitorService monitorService;
@ApiOperation(value = "服务接口", notes = "用于获取服务列表")
@GetMapping("monitor/server")
public ResResult getDeviceTypes() {
......@@ -29,11 +33,13 @@ public class OperateController {
}
@ApiOperation(value = "在线数量添加接口", notes = "用于添加当前在线数量")
@PostMapping("monitor/add")
public boolean addMonitor() {
return monitorService.addMonitor(20);
}
@ApiOperation(value = "获取并发量接口", notes = "用于获取并发量")
@GetMapping("monitor/qps")
public ResResult getQps(@RequestParam("type") int type) {
......
package iot.sixiang.license.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.resource.ResourceManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -13,11 +15,13 @@ import java.io.IOException;
@RestController
@RequestMapping("/resource")
@Api(value = "资源模块", tags = {"资源模块"})
public class ResourceContrller {
@Autowired
ResourceManager resourceManager;
@ApiOperation(value = "资源下载接口", notes = "用于下载资源")
@GetMapping("/download")
public void downloadWorkHourRecordTemplate(HttpServletResponse response, @RequestParam(value = "userId") int userId) {
......
package iot.sixiang.license.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.model.ResResult;
import iot.sixiang.license.model.SamMonitor;
import iot.sixiang.license.operate.OperateManager;
......@@ -18,11 +20,13 @@ import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/iot_license/sam")
@Api(value = "sam管理模块", tags = {"sam管理模块"})
public class SamMapController {
@Autowired
public OperateManager operateManager;
@ApiOperation(value = "统计sam总数接口", notes = "用于统计sam的总数和总在线数量")
@GetMapping("count")
public ResResult getSamTotalCount() {
Map<String, SamMonitor> samMonitorMap = operateManager.getSamMonitorMap();
......
......@@ -2,6 +2,8 @@ package iot.sixiang.license.controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.entity.Server;
import iot.sixiang.license.model.BaseResult;
import iot.sixiang.license.model.ResResult;
......@@ -21,6 +23,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/iot_license/server")
@Api(value = "服务模块", tags = {"服务模块"})
public class ServerController {
@Autowired
......@@ -31,6 +34,7 @@ public class ServerController {
* @param jsonObject
* @return
*/
@ApiOperation(value = "添加服务接口", notes = "用于添加服务")
@PostMapping("add")
public BaseResult addServer(@RequestBody JSONObject jsonObject) {
String serverIp = jsonObject.getString("serverIp");
......@@ -48,6 +52,7 @@ public class ServerController {
* @param serverIp
* @return
*/
@ApiOperation(value = "删除服务接口", notes = "删除服务")
@PostMapping("delete")
public BaseResult deleteServer(@RequestParam("serverIp") String serverIp) {
boolean res = serverService.deleteServer(serverIp);
......@@ -63,6 +68,7 @@ public class ServerController {
* @param jsonObject
* @return
*/
@ApiOperation(value = "修改服务接口", notes = "修改服务")
@PostMapping("update")
public BaseResult updateServer(@RequestBody JSONObject jsonObject) {
String serverIp = jsonObject.getString("serverIp");
......@@ -82,6 +88,7 @@ public class ServerController {
* @param pageSize
* @return
*/
@ApiOperation(value = "获取服务列表接口", notes = "用于获取服务列表")
@GetMapping("list")
public ResResult getServerList(@RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize) {
List<Server> records = serverService.getServerList(pageNo,pageSize);
......
......@@ -2,6 +2,11 @@ package iot.sixiang.license.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.model.BaseResult;
import iot.sixiang.license.model.PageInfoModel;
import iot.sixiang.license.model.PageResult;
......@@ -23,6 +28,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/iot_license/user")
@Api(value = "用户模块", tags = {"用户模块"})
public class UserController {
@Autowired
......@@ -33,7 +39,12 @@ public class UserController {
* @param jsonObject
* @return
*/
@ApiOperation(value = "用户添加接口", notes = "用于添加用户")
@PostMapping("add")
@ApiOperationSupport(params = @DynamicParameters(name = "jsonObject",properties = {
@DynamicParameter(name = "userName",value = "账户名",required = true,dataTypeClass = String.class),
@DynamicParameter(name = "company",value = "公司名",required = true,dataTypeClass = String.class)
}))
public BaseResult addUser(@RequestBody JSONObject jsonObject) {
String userName = (String) jsonObject.get("userName");
String company = (String) jsonObject.get("company");
......@@ -51,6 +62,7 @@ public class UserController {
* @param userId
* @return
*/
@ApiOperation(value = "用户删除接口", notes = "删除用户")
@PostMapping("delete")
public BaseResult deleteUser(@RequestParam("userId") int userId) {
boolean res = userService.deleteUser(userId);
......@@ -66,6 +78,7 @@ public class UserController {
* @param jsonObject
* @return
*/
@ApiOperation(value = "用户修改接口", notes = "修改用户")
@PostMapping("update")
public BaseResult updateUser(@RequestBody JSONObject jsonObject) {
int userId = jsonObject.getInteger("userId");
......@@ -85,6 +98,7 @@ public class UserController {
* @param pageSize
* @return
*/
@ApiOperation(value = "获取用户列表接口", notes = "用于获取用户列表")
@GetMapping("list")
public PageResult getUserList(@RequestParam(value = "pageNo", defaultValue = "0") int pageNo,
@RequestParam(value = "pageSize",defaultValue = "0") int pageSize,
......
......@@ -2,6 +2,8 @@ package iot.sixiang.license.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -12,14 +14,24 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("告警实体类")
public class Alarm {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@ApiModelProperty("主键Id")
private Integer id;
@ApiModelProperty("告警类型Id")
private int typeId;
@ApiModelProperty("告警标题")
private String title;
@ApiModelProperty("告警内容")
private String content;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("告警创建时间")
private Date createTime;
}
......@@ -2,6 +2,8 @@ package iot.sixiang.license.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -21,6 +23,7 @@ import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("告警已读实体类")
public class AlarmRead implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -29,37 +32,44 @@ public class AlarmRead implements Serializable {
* 告警已读唯一id
*/
@TableId(type = IdType.AUTO)
@ApiModelProperty("主键Id")
private Integer id;
/**
* 告警id
*/
@ApiModelProperty("告警Id")
private int alarmId;
/**
* 告警类型id
*/
@ApiModelProperty("告警类型Id")
private int typeId;
/**
* 告警标题
*/
@ApiModelProperty("告警标题")
private String title;
/**
* 告警内容
*/
@ApiModelProperty("告警内容")
private String content;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 阅读用户id
*/
@ApiModelProperty("阅读用户Id")
private Integer userId;
......
......@@ -2,6 +2,8 @@ package iot.sixiang.license.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -19,6 +21,7 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("告警类型实体类")
public class AlarmType implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -26,17 +29,20 @@ public class AlarmType implements Serializable {
/**
* 告警类型id
*/
@ApiModelProperty("主键Id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 等级
*/
@ApiModelProperty("告警等级")
private Integer level;
/**
* 等级描述
*/
@ApiModelProperty("等级描述")
private String levelDescribe;
......
......@@ -2,6 +2,8 @@ package iot.sixiang.license.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -19,17 +21,22 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("应用实体类")
public class Apply implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("应用Id")
@TableId(type = IdType.AUTO)
private Integer appId;
@ApiModelProperty("应用名")
private String appName;
@ApiModelProperty("应用key")
private String appKey;
@ApiModelProperty("用户Id")
private Integer userId;
}
......@@ -2,6 +2,8 @@ package iot.sixiang.license.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -19,15 +21,19 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("设备实体类")
public class Device implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键Id")
@TableId(type = IdType.AUTO)
private Integer deviceId;
@ApiModelProperty("设备编号")
private String sn;
@ApiModelProperty("应用Id")
private Integer appId;
}
......@@ -2,6 +2,8 @@ package iot.sixiang.license.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -20,6 +22,7 @@ import java.time.LocalDate;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("运维实体类")
public class Monitor implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -27,22 +30,26 @@ public class Monitor implements Serializable {
/**
* 主键id
*/
@ApiModelProperty("主键Id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 年月日
*/
@ApiModelProperty("日期")
private LocalDate date;
/**
* 时
*/
@ApiModelProperty("小时")
private Integer hour;
/**
* 在线数量
*/
@ApiModelProperty("在线数量")
private Integer count;
......
package iot.sixiang.license.entity;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
......@@ -16,12 +19,15 @@ import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("服务实体类")
public class Server implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("服务Ip")
private String serverIp;
@ApiModelProperty("端口")
private Integer port;
......
......@@ -2,6 +2,8 @@ package iot.sixiang.license.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -19,16 +21,21 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("用户实体类")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("用户Id")
@TableId(type = IdType.AUTO)
private Integer userId;
@ApiModelProperty("密码")
private String password;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("公司")
private String company;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment