
-- cas table

-- ----------------------------
-- Table structure for cas_config
-- ----------------------------

DROP SEQUENCE IF EXISTS "public"."cas_config_id_seq";
CREATE SEQUENCE IF NOT EXISTS "public"."cas_config_id_seq" AS integer;

CREATE TABLE "public"."cas_config" (
                                       "id" int4 NOT NULL DEFAULT nextval('cas_config_id_seq'::regclass),
                                       "group_name" varchar(255) COLLATE "pg_catalog"."default",
                                       "source_key" varchar(255) COLLATE "pg_catalog"."default",
                                       "source_value" varchar(10485759) COLLATE "pg_catalog"."default"
)
;

-- ----------------------------
-- Primary Key structure for table cas_config
-- ----------------------------
ALTER TABLE "public"."cas_config" ADD CONSTRAINT "cas_config_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Table structure for cas_service_detail
-- ----------------------------

DROP SEQUENCE IF EXISTS "public"."cas_service_detail_id_seq";
CREATE SEQUENCE IF NOT EXISTS "public"."cas_service_detail_id_seq" AS integer;

CREATE TABLE "public"."cas_service_detail" (
                                               "id" int4 NOT NULL DEFAULT nextval('cas_service_detail_id_seq'::regclass),
                                               "endpoints" varchar(255) COLLATE "pg_catalog"."default",
                                               "group_id" int4,
                                               "logo" varchar(10485759) COLLATE "pg_catalog"."default",
                                               "product_code" varchar(255) COLLATE "pg_catalog"."default",
                                               "sequence" int4,
                                               "service_code" varchar(255) COLLATE "pg_catalog"."default",
                                               "service_name" varchar(255) COLLATE "pg_catalog"."default",
                                               "service_version" varchar(255) COLLATE "pg_catalog"."default",
                                               "submenu_logo" varchar(10485759) COLLATE "pg_catalog"."default",
                                               "url" varchar(255) COLLATE "pg_catalog"."default",
                                               "visible" bool NOT NULL
)
;

-- ----------------------------
-- Uniques structure for table cas_service_detail
-- ----------------------------
ALTER TABLE "public"."cas_service_detail" ADD CONSTRAINT "服务编码不能重复" UNIQUE ("service_code");
ALTER TABLE "public"."cas_service_detail" ADD CONSTRAINT "服务名称不能重复" UNIQUE ("service_name");
ALTER TABLE "public"."cas_service_detail" ADD CONSTRAINT "同一服务下服务版本号不能重复" UNIQUE ("service_name", "service_version");
ALTER TABLE "public"."cas_service_detail" ADD CONSTRAINT "服务产品号不能重复" UNIQUE ("product_code");

-- ----------------------------
-- Primary Key structure for table cas_service_detail
-- ----------------------------
ALTER TABLE "public"."cas_service_detail" ADD CONSTRAINT "cas_service_detail_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Table structure for cas_service_group
-- ----------------------------

DROP SEQUENCE IF EXISTS "public"."cas_service_group_id_seq";
CREATE SEQUENCE IF NOT EXISTS "public"."cas_service_group_id_seq" AS integer;

CREATE TABLE "public"."cas_service_group" (
                                              "id" int4 NOT NULL DEFAULT nextval('cas_service_group_id_seq'::regclass),
                                              "group_name" varchar(255) COLLATE "pg_catalog"."default",
                                              "logo" varchar(10485759) COLLATE "pg_catalog"."default",
                                              "visible" bool NOT NULL
)
;

-- ----------------------------
-- Uniques structure for table cas_service_group
-- ----------------------------
ALTER TABLE "public"."cas_service_group" ADD CONSTRAINT "分组名称不能重复" UNIQUE ("group_name");

-- ----------------------------
-- Primary Key structure for table cas_service_group
-- ----------------------------
ALTER TABLE "public"."cas_service_group" ADD CONSTRAINT "cas_service_group_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Table structure for cas_user
-- ----------------------------

DROP SEQUENCE IF EXISTS "public"."cas_user_id_seq";
CREATE SEQUENCE IF NOT EXISTS "public"."cas_user_id_seq" AS integer;

CREATE TABLE "public"."cas_user" (
                                     "id" int8 NOT NULL DEFAULT nextval('cas_user_id_seq'::regclass),
                                     "ding_talk_id" varchar(128) COLLATE "pg_catalog"."default",
                                     "ding_talk_union_id" varchar(128) COLLATE "pg_catalog"."default",
                                     "email" varchar(64) COLLATE "pg_catalog"."default",
                                     "ext_attrs" varchar(4096) COLLATE "pg_catalog"."default",
                                     "gmt_create" timestamp(6),
                                     "gmt_last_login" timestamp(6),
                                     "gmt_modify" timestamp(6),
                                     "gmt_password_modify" timestamp(6),
                                     "ldap_account" varchar(128) COLLATE "pg_catalog"."default",
                                     "mobile_phone" varchar(32) COLLATE "pg_catalog"."default",
                                     "password" varchar(255) COLLATE "pg_catalog"."default",
                                     "password_need_change" int2,
                                     "status" int2,
                                     "user_account" varchar(64) COLLATE "pg_catalog"."default",
                                     "user_nick" varchar(64) COLLATE "pg_catalog"."default",
                                     "version" int8
)
;

-- ----------------------------
-- Uniques structure for table cas_user
-- ----------------------------
ALTER TABLE "public"."cas_user" ADD CONSTRAINT "IDX_USER_ACCOUNT" UNIQUE ("user_account");

-- ----------------------------
-- Primary Key structure for table cas_user
-- ----------------------------
ALTER TABLE "public"."cas_user" ADD CONSTRAINT "cas_user_pkey" PRIMARY KEY ("id");


-- cas
INSERT INTO public.cas_config(id, group_name, source_key, source_value) VALUES (1540,'login_config','name','上海慧程'),(1541,'login_config','owe','慧程官网'),(1542,'login_config','community','needle社区'),(1543,'login_config','copyright','© Copyright 2016 - 2020 Shanghai H VISIONS Technology Co., Ltd.'),(1544,'login_config','index_bigLogo','data:image/png;base64,[encoded data, 6920 characters]'),(1545,'login_config','index_bgPic','data:image/png;base64,[encoded data, 133912 characters]'),(1546,'login_config','index_pic','data:image/png;base64,[encoded data, 107022 characters]
[encoded data, 127894 characters]'),(1547,'login_config','index_logo','data:image/png;base64,[encoded data, 6976 characters]'),(1548,'login_config','content','公司介绍'),(1549,'login_config','show','true'),(1550,'theme_config','@primary-color','#24A1C8'),(1551,'theme_config','@ne-primary-bg-color','rgba(36,161,200,0.15)'),(1552,'theme_config','@ne-layout-secondary-menu-bg-color','rgba(36,161,200,0.15)'),(1553,'theme_config','@link-color','#24A1C8'),(1554,'theme_config','@input-hover-border-color','#24A1C8'),(1555,'theme_config','@ne-layout-menu-logo-color','#009bbf'),(1556,'theme_config','@ne-layout-header-background','#def1f7'),(1557,'locale_config','locale_switch','true');


select setval('public.cas_config_id_seq'::regclass, 2000);



INSERT INTO public.cas_service_detail(id, group_id, logo, product_code, sequence, service_code, service_name, url, visible, endpoints, service_version, submenu_logo) VALUES (1,1,'data:image/svg+xml;base64,PHN2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BzdG9wLWNvbG9yPSIjQTE0Q0ZBIi8+CjxzdG9wIG9mZnNldD0iMC44IiBzdG9wLWNvbG9yPSIjQjQ0RUY5Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0JCNEZGOSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50Ml9saW5lYXJfMV8xNzIiIHgxPSI1OC4xMSIgeTE9IjExLjc5IiB4Mj0iMjEuNTYiIHkyPSIzNi4wMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjNkY0N0ZEIi8+CjxzdG9wIG9mZnNldD0iMC4xOCIgc3RvcC1jb2xvcj0iIzgyNDlGQiIvPgo8c3RvcCBvZmZzZXQ9IjAuNTEiIHN0b3AtY29sb3I9IiNBMTRDRkEiLz4KPHN0b3Agb2Zmc2V0PSIwLjgiIHN0b3AtY29sb3I9IiNCNDRFRjkiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjQkI0RkY5Ii8+CjwvbGluZWFyR3JhZGllbnQ+CjxjbGlwUGF0aCBpZD0iY2xpcDBfMV8xNzIiPgo8cmVjdCB3aWR0aD0iNTUuNjEiIGhlaWdodD0iNjQuMjIiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMCA1KSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=','H02B201',10,'hiper-matrix','边缘节点系统','http://10.60.16.29:9030/', 1, NULL,'1.0.0','data:image/png;base64,[encoded data, 6920 characters]'),(36,21,'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABBCAYAAABhNaJ7AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAPYSURBVHgB7ZuBldowDIbFTUAnaEZgg2aDskG9AWxwdILjJoC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X5LxkbCLkAyNj22bbnewUkFIAt6OvzLVaLu5XfQ16cLLxwVPQKK+mfsEpxJRWpMKUd8uKkG+ui/mHqGUvV5kJDg2NybD5TMAKd6fCbTKU9vb82IXugUlZJ2w/A5wztFLQEPqVn4yDUcX7r40etaUwd6eVPmjleX58XZWSkH/r6/Ip8niRXj+8XlIo/1FhhjhSJ340AAAAASUVORK5CYII=','CAS',0,'CAS','统一登录','http://10.60.16.29:8060/console', 1,NULL,'2.1.0','data:image/png;base64,[encoded data, 8076 characters]');

select setval('public.cas_service_detail_id_seq'::regclass, 100);



INSERT INTO public.cas_service_group (id, group_name, logo, visible) VALUES (1,'HiperMARIX物联网平台','data:image/png;base64,[encoded data, 7612 characters]', 1),(21,'HIperM3基础服务','data:image/svg+xml;base64,[encoded data, 17112 characters]',1);


select setval('public.cas_service_group_id_seq'::regclass, 100);


INSERT INTO public.cas_user(id, gmt_create,gmt_modify,user_account, user_nick,status,password, password_need_change, gmt_password_modify, email, mobile_phone,ding_talk_id,
                     ding_talk_union_id, gmt_last_login, version, ext_attrs, ldap_account) VALUES (1,'2023-05-30 10:45:00','2024-01-03 11:28:38','admin','管理员',0,'85efbb4f5173a5609dd6c50115d5c866409e0b210c28b17951f01a91180bc1100bc9c8d01ae3771c',0,'2023-12-04 17:57:04','dev@h-visions.com','',NULL,NULL,'2024-01-03 11:14:40',NULL,NULL,'');


select setval('public.cas_user_id_seq'::regclass, 100);