Skip to content

Commit

Permalink
Merge pull request #32 from fqliao/feature-milestone2
Browse files Browse the repository at this point in the history
reuse dataset mapper for admin
  • Loading branch information
fqliao authored Aug 31, 2024
2 parents 09ed567 + ded0976 commit e46eacd
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions wedpr-adm/db/wedpr_ddl.sql → db/wedpr_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,42 @@ create table if not exists `wedpr_jupyter_table`(
index access_entrypoint_index(`access_entrypoint`(128))
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- 创建机构表
CREATE TABLE IF NOT EXISTS wedpr_agency (
agency_id VARCHAR(64) NOT NULL comment "机构编号",
agency_name VARCHAR(64) NOT NULL comment "机构名",
agency_desc text NOT NULL comment "机构描述",
agency_contact VARCHAR(64) NOT NULL comment "机构联系人",
contact_phone VARCHAR(64) NOT NULL comment "联系电话",
gateway_endpoint VARCHAR(64) NOT NULL comment "网关地址",
agency_status TINYINT DEFAULT 0 NOT NULL comment "机构状态(0:启用,1:禁用)",
user_count INT DEFAULT 0 comment "机构用户数",
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
create_by VARCHAR(20) NOT NULL DEFAULT '',
update_by VARCHAR(20) NOT NULL DEFAULT '',
PRIMARY KEY (agency_id),
INDEX idx_agency_name (agency_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- 创建机构证书表
CREATE TABLE IF NOT EXISTS wedpr_cert (
cert_id VARCHAR(64) NOT NULL comment "证书id",
agency_id VARCHAR(64) NOT NULL comment "机构编号",
agency_name VARCHAR(64) NOT NULL comment "机构名",
csr_file_name VARCHAR(64) NOT NULL comment "机构证书请求文件名",
csr_file_text text NOT NULL comment "机构证书请求文件内容",
cert_file_text text NOT NULL comment "机构证书文件内容",
expire_time DATETIME NOT NULL comment "过期时间",
cert_status TINYINT DEFAULT 0 NOT NULL comment "证书状态(0:无证书,1:有效,2:过期,3:禁用)",
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
create_by VARCHAR(20) NOT NULL DEFAULT '',
update_by VARCHAR(20) NOT NULL DEFAULT '',
PRIMARY KEY (cert_id),
INDEX idx_agency_name (agency_name),
INDEX idx_cert_status (cert_status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;
-- the api credential table
create table if not exists `wedpr_api_credential_table`(
`id` varchar(64) not null comment "id",
Expand Down
9 changes: 8 additions & 1 deletion wedpr-adm/db/wedpr_dml.sql → db/wedpr_dml.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ values("9112736673759237", "wedpr_data_auth", "数据审批模板", '{"name":"we

insert into wedpr_group (group_id, group_name, admin_name, status) values('1000000000000000', '初始用户组', 'admin', 0);
insert into wedpr_group_detail (group_id, username, status) values('1000000000000000', 'admin', 0);

-- 站点端初始化
insert into wedpr_user (username, password, status) values('admin', '{bcrypt}$2a$10$9ZhDOBp.sRKat4l14ygu/.LscxrMUcDAfeVOEPiYwbcRkoB09gCmi', 0);
insert into wedpr_user_role(username, role_id) values ('admin', '1');
insert into wedpr_role_permission (role_id, role_name, permission_id) values ('1', 'admin_user', '1')
insert into wedpr_role_permission (role_id, role_name, permission_id) values ('2', 'original_user', '2')
insert into wedpr_role_permission (role_id, role_name, permission_id) values ('2', 'original_user', '2')

-- 管理端初始化
insert into wedpr_user (username, password, status) values('admin', '{bcrypt}$2a$10$XuiuKLg23kxtC/ldvYN0/evt0Y3aoBC9iV29srhIBMMDORzCQiYA.', 0);
insert into wedpr_user_role(username, role_id) values ('admin', '10');
insert into wedpr_role_permission (role_id, role_name, permission_id) values ('10', 'admin_user', '1')
5 changes: 0 additions & 5 deletions wedpr-admin/db/wedpr_admin_dml.sql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.webank.wedpr.components.admin.common.Utils;
import com.webank.wedpr.components.admin.mapper.WedprDatasetMapper;
import com.webank.wedpr.components.admin.request.GetWedprDatasetListRequest;
import com.webank.wedpr.components.admin.service.WedprDatasetService;
import com.webank.wedpr.components.dataset.dao.Dataset;
import com.webank.wedpr.components.dataset.mapper.DatasetMapper;
import com.webank.wedpr.components.dataset.message.ListDatasetResponse;
import java.time.LocalDateTime;
import org.springframework.stereotype.Service;
Expand All @@ -20,7 +20,7 @@
* @since 2024-08-29
*/
@Service
public class WedprDatasetServiceImpl extends ServiceImpl<WedprDatasetMapper, Dataset>
public class WedprDatasetServiceImpl extends ServiceImpl<DatasetMapper, Dataset>
implements WedprDatasetService {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.webank.wedpr.components.dataset.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.webank.wedpr.components.dataset.dao.Dataset;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface DatasetMapper {
public interface DatasetMapper extends BaseMapper<Dataset> {

/**
* query dataset by dataset_id
Expand Down

0 comments on commit e46eacd

Please sign in to comment.