添加UI设置的数据库及获取UI设置的接口描述
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
package com.gzzn.omms.adminapi.controller.settings;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.gzzn.omms.adminapi.dto.ResponseDto;
|
||||||
|
import com.gzzn.omms.adminapi.dto.settings.FindByCurUserAndCondsDto;
|
||||||
|
import com.gzzn.omms.adminapi.dto.settings.UisettingsDto;
|
||||||
|
import com.gzzn.omms.adminapi.enums.ResultCode;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class UISettingsController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查找当前用户所有UI设置
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value="根据条件获取当前用户的UI设置",tags="UI设置")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name="envCode",value="环境Code",dataType="string", paramType = "query",example="web"),
|
||||||
|
@ApiImplicitParam(name="groupCode",value="分组Code",dataType="string", paramType = "query",example="msgalert")})
|
||||||
|
@GetMapping(value="/settings/uisettings")
|
||||||
|
public ResponseDto<List<UisettingsDto>> findByCurUserAndConds(
|
||||||
|
@RequestParam(required=false)
|
||||||
|
FindByCurUserAndCondsDto conditionsDto)
|
||||||
|
{
|
||||||
|
return ResponseDto.failure(ResultCode.INTERFACE_NOT_IMPLEMENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.gzzn.omms.adminapi.domain.primary.entity.settings;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The persistent class for the uisettings database table.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name="uisettings")
|
||||||
|
@NamedQuery(name="Uisettings.findAll", query="SELECT u FROM Uisettings u")
|
||||||
|
public class Uisettings implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Column(name="env_code")
|
||||||
|
private String envCode;
|
||||||
|
|
||||||
|
@Column(name="group_code")
|
||||||
|
private String groupCode;
|
||||||
|
|
||||||
|
@Column(name="setting_content")
|
||||||
|
private String settingContent;
|
||||||
|
|
||||||
|
private String userid;
|
||||||
|
|
||||||
|
public Uisettings() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnvCode() {
|
||||||
|
return this.envCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnvCode(String envCode) {
|
||||||
|
this.envCode = envCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupCode() {
|
||||||
|
return this.groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupCode(String groupCode) {
|
||||||
|
this.groupCode = groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSettingContent() {
|
||||||
|
return this.settingContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSettingContent(String settingContent) {
|
||||||
|
this.settingContent = settingContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserid() {
|
||||||
|
return this.userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserid(String userid) {
|
||||||
|
this.userid = userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+64
@@ -0,0 +1,64 @@
|
|||||||
|
package com.gzzn.omms.adminapi.domain.primary.entity.settings;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The persistent class for the uisettings_default database table.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name="uisettings_default")
|
||||||
|
@NamedQuery(name="UisettingsDefault.findAll", query="SELECT u FROM UisettingsDefault u")
|
||||||
|
public class UisettingsDefault implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Column(name="env_code")
|
||||||
|
private String envCode;
|
||||||
|
|
||||||
|
@Column(name="group_code")
|
||||||
|
private String groupCode;
|
||||||
|
|
||||||
|
@Column(name="setting_content")
|
||||||
|
private String settingContent;
|
||||||
|
|
||||||
|
public UisettingsDefault() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnvCode() {
|
||||||
|
return this.envCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnvCode(String envCode) {
|
||||||
|
this.envCode = envCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupCode() {
|
||||||
|
return this.groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupCode(String groupCode) {
|
||||||
|
this.groupCode = groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSettingContent() {
|
||||||
|
return this.settingContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSettingContent(String settingContent) {
|
||||||
|
this.settingContent = settingContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.gzzn.omms.adminapi.dto.settings;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
public class FindByCurUserAndCondsDto {
|
||||||
|
@ApiModelProperty(value="环境Code",example="web")
|
||||||
|
private String envCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="分组Code",example="msgalert")
|
||||||
|
private String groupCode;
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.gzzn.omms.adminapi.dto.settings;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
@ApiModel(value="UisettingsDto",description="UI设置Dto")
|
||||||
|
public class UisettingsDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value="用户id",example="1")
|
||||||
|
private String userid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="环境Code",example="web")
|
||||||
|
private String envCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="分组Code",example="msgalert")
|
||||||
|
private String groupCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="设置的具体内容json串",example="{\"key1\": \"value1\",\"key2\": \"value2\"}")
|
||||||
|
private String settingContent;
|
||||||
|
|
||||||
|
|
||||||
|
public String getEnvCode() {
|
||||||
|
return envCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnvCode(String envCode) {
|
||||||
|
this.envCode = envCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGroupCode() {
|
||||||
|
return groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupCode(String groupCode) {
|
||||||
|
this.groupCode = groupCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSettingContent() {
|
||||||
|
return settingContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSettingContent(String settingContent) {
|
||||||
|
this.settingContent = settingContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserid() {
|
||||||
|
return userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserid(String userid) {
|
||||||
|
this.userid = userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,17 +15,19 @@ CREATE TABLE `datadic_items` (
|
|||||||
|
|
||||||
|
|
||||||
CREATE TABLE `uisettings` (
|
CREATE TABLE `uisettings` (
|
||||||
|
`id` varchar(64) NOT NULL,
|
||||||
`userid` varchar(64) NOT NULL COMMENT '用户id,用户id',
|
`userid` varchar(64) NOT NULL COMMENT '用户id,用户id',
|
||||||
`env_code` varchar(64) NOT NULL COMMENT '环境配置code , web - 大屏幕环境 mobile - 移动小屏幕 ',
|
`env_code` varchar(64) NOT NULL COMMENT '环境配置code , web - 大屏幕环境 mobile - 移动小屏幕 ',
|
||||||
`group_code` varchar(64) NOT NULL COMMENT '设置分组,设置分组比如msgalert 消息提醒',
|
`group_code` varchar(64) NOT NULL COMMENT '设置分组,设置分组比如msgalert 消息提醒',
|
||||||
`setting_content` varchar(20000) DEFAULT NULL COMMENT '具体的设置内容,json格式的设置内容。不超过60KB',
|
`setting_content` varchar(20000) NOT NULL COMMENT '具体的设置内容,json格式的设置内容。不超过60KB',
|
||||||
PRIMARY KEY (`userid`,`env_code`,`group_code`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ui设置表,用户个人的UI设置习惯';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ui设置表,用户个人的UI设置习惯';
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `uisettings_default` (
|
CREATE TABLE `uisettings_default` (
|
||||||
|
`id` varchar(64) NOT NULL,
|
||||||
`env_code` varchar(64) NOT NULL COMMENT '环境配置code , web - 大屏幕环境 mobile - 移动小屏幕 ',
|
`env_code` varchar(64) NOT NULL COMMENT '环境配置code , web - 大屏幕环境 mobile - 移动小屏幕 ',
|
||||||
`group_code` varchar(64) NOT NULL COMMENT '设置分组,设置分组比如msgalert 消息提醒',
|
`group_code` varchar(64) NOT NULL COMMENT '设置分组,设置分组比如msgalert 消息提醒',
|
||||||
`setting_content` varchar(20000) DEFAULT NULL COMMENT '具体的设置内容,json格式的设置内容。不超过60KB',
|
`setting_content` varchar(20000) NOT NULL COMMENT '具体的设置内容,json格式的设置内容。不超过60KB',
|
||||||
PRIMARY KEY (`env_code`,`group_code`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ui默认设置表,UI的默认设置';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ui默认设置表,UI的默认设置';
|
||||||
|
|||||||
Reference in New Issue
Block a user