mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-02 13:34:07 +08:00
Modify some team codes
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
package ai.chat2db.server.domain.api.model;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import ai.chat2db.server.tools.base.constant.EasyToolsConstant;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* Team
|
||||
*
|
||||
* @author Jiaju Zhuang
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Team implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = EasyToolsConstant.SERIAL_VERSION_UID;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 团队编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 团队状态
|
||||
*
|
||||
* @see ai.chat2db.server.domain.api.enums.ValidStatusEnum
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
@ -53,7 +53,7 @@ CREATE TABLE IF NOT EXISTS `team`
|
||||
create UNIQUE INDEX uk_team_code on team (code);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `team_dbhub_user`
|
||||
CREATE TABLE IF NOT EXISTS `team_user`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
@ -61,14 +61,14 @@ CREATE TABLE IF NOT EXISTS `team_dbhub_user`
|
||||
`create_user_id` bigint(20) unsigned NOT NULL COMMENT '创建人用户id',
|
||||
`modified_user_id` bigint(20) unsigned NOT NULL COMMENT '修改人用户id',
|
||||
`team_id` bigint(20) unsigned NOT NULL COMMENT '团队id',
|
||||
`dbhub_user_id` bigint(20) unsigned NOT NULL COMMENT '用户id',
|
||||
`user_id` bigint(20) unsigned NOT NULL COMMENT '用户id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='用户团队表'
|
||||
;
|
||||
|
||||
create INDEX idx_team_dbhub_user_team_id on team_dbhub_user (`team_id`);
|
||||
create INDEX idx_team_dbhub_user_dbhub_user_id on team_dbhub_user (`dbhub_user_id`);
|
||||
create INDEX idx_team_user_team_id on team_user (`team_id`);
|
||||
create INDEX idx_team_user_user_id on team_user (`user_id`);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `data_source_access`
|
||||
(
|
||||
|
@ -32,7 +32,9 @@ public class MybatisGeneratorTest extends BaseTest {
|
||||
//doGenerator(Lists.newArrayList("data_source"));
|
||||
//doGenerator(Lists.newArrayList("operation_log"));
|
||||
//doGenerator(Lists.newArrayList("operation_saved"));
|
||||
doGenerator(Lists.newArrayList("environment","data_source","team","team_dbhub_user","data_source_access","dbhub_user"));
|
||||
//doGenerator(Lists.newArrayList("environment","data_source","team","team_dbhub_user","data_source_access",
|
||||
// "dbhub_user"));
|
||||
doGenerator(Lists.newArrayList("team_user"));
|
||||
}
|
||||
|
||||
private void doGenerator(List<String> tableList) {
|
||||
|
@ -0,0 +1,37 @@
|
||||
|
||||
package ai.chat2db.server.admin.api.controller.team.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* team
|
||||
*
|
||||
* @author Jiaju Zhuang
|
||||
*/
|
||||
@Data
|
||||
public class SimpleTeamVO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 团队编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 团队状态
|
||||
*
|
||||
* @see ai.chat2db.server.domain.api.enums.ValidStatusEnum
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
|
||||
package ai.chat2db.server.admin.api.controller.user;
|
||||
|
||||
import ai.chat2db.server.admin.api.controller.user.converter.DataSourceAdminConverter;
|
||||
import ai.chat2db.server.admin.api.controller.user.request.DataSourceAccessBatchCreateRequest;
|
||||
import ai.chat2db.server.admin.api.controller.user.request.DataSourceAccessPageQueryRequest;
|
||||
import ai.chat2db.server.admin.api.controller.user.vo.DataSourceAccessPageQueryVO;
|
||||
import ai.chat2db.server.domain.api.service.DataSourceService;
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ActionResult;
|
||||
import ai.chat2db.server.tools.base.wrapper.result.web.WebPageResult;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Data Source Access Management
|
||||
*
|
||||
* @author Jiaju Zhuang
|
||||
*/
|
||||
@RequestMapping("/api/admin/data/source/access")
|
||||
@RestController
|
||||
public class DataSourceAccessController {
|
||||
|
||||
@Resource
|
||||
private DataSourceService dataSourceService;
|
||||
@Resource
|
||||
private DataSourceAdminConverter dataSourceAdminConverter;
|
||||
|
||||
/**
|
||||
* Pagination query
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
* @version 2.1.0
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public WebPageResult<DataSourceAccessPageQueryVO> page(@Valid DataSourceAccessPageQueryRequest request) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* batch
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
* @version 2.1.0
|
||||
*/
|
||||
@PostMapping("/batch-create")
|
||||
public ActionResult batchCreate(@RequestBody DataSourceAccessBatchCreateRequest request) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* delete
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public ActionResult delete(@PathVariable Long id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
|
||||
package ai.chat2db.server.admin.api.controller.user.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Pagination query
|
||||
*
|
||||
* @author Jiaju Zhuang
|
||||
*/
|
||||
@Data
|
||||
public class UserTeamPageQueryVO {
|
||||
|
||||
/**
|
||||
* user id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 团队编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 团队状态
|
||||
*
|
||||
* @see ai.chat2db.server.domain.api.enums.ValidStatusEnum
|
||||
*/
|
||||
private String status;
|
||||
}
|
Reference in New Issue
Block a user