@@ -0,0 +1,9 @@ | |||||
# Getting Started | |||||
### Reference Documentation | |||||
For further reference, please consider the following sections: | |||||
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) | |||||
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.0/maven-plugin/reference/html/) | |||||
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.0/maven-plugin/reference/html/#build-image) | |||||
@@ -0,0 +1,154 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<project xmlns="http://maven.apache.org/POM/4.0.0" | |||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||||
<parent> | |||||
<artifactId>server</artifactId> | |||||
<groupId>org.dubhe</groupId> | |||||
<version>0.0.1-SNAPSHOT</version> | |||||
</parent> | |||||
<modelVersion>4.0.0</modelVersion> | |||||
<artifactId>admin</artifactId> | |||||
<name>Admin 系统服务</name> | |||||
<dependencies> | |||||
<!-- Biz 通用配置 --> | |||||
<dependency> | |||||
<groupId>org.dubhe.biz</groupId> | |||||
<artifactId>base</artifactId> | |||||
<version>${org.dubhe.biz.base.version}</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.dubhe.biz</groupId> | |||||
<artifactId>file</artifactId> | |||||
<version>${org.dubhe.biz.file.version}</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.dubhe.biz</groupId> | |||||
<artifactId>data-permission</artifactId> | |||||
<version>${org.dubhe.biz.data-permission.version}</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.dubhe.biz</groupId> | |||||
<artifactId>redis</artifactId> | |||||
<version>${org.dubhe.biz.redis.version}</version> | |||||
</dependency> | |||||
<!-- 注册中心 --> | |||||
<dependency> | |||||
<groupId>org.dubhe.cloud</groupId> | |||||
<artifactId>registration</artifactId> | |||||
<version>${org.dubhe.cloud.registration.version}</version> | |||||
</dependency> | |||||
<!-- 配置中心 --> | |||||
<dependency> | |||||
<groupId>org.dubhe.cloud</groupId> | |||||
<artifactId>configuration</artifactId> | |||||
<version>${org.dubhe.cloud.configuration.version}</version> | |||||
</dependency> | |||||
<!-- Cloud swagger --> | |||||
<dependency> | |||||
<groupId>org.dubhe.cloud</groupId> | |||||
<artifactId>swagger</artifactId> | |||||
<version>${org.dubhe.cloud.swagger.version}</version> | |||||
</dependency> | |||||
<!-- 统一Rest返回工具结构 --> | |||||
<dependency> | |||||
<groupId>org.dubhe.biz</groupId> | |||||
<artifactId>data-response</artifactId> | |||||
<version>${org.dubhe.biz.data-response.version}</version> | |||||
</dependency> | |||||
<!-- 统一权限配置 --> | |||||
<dependency> | |||||
<groupId>org.dubhe.cloud</groupId> | |||||
<artifactId>auth-config</artifactId> | |||||
<version>${org.dubhe.cloud.auth-config.version}</version> | |||||
</dependency> | |||||
<!-- 远程调用 --> | |||||
<dependency> | |||||
<groupId>org.dubhe.cloud</groupId> | |||||
<artifactId>remote-call</artifactId> | |||||
<version>${org.dubhe.cloud.remote-call.version}</version> | |||||
</dependency> | |||||
<!-- log依赖--> | |||||
<dependency> | |||||
<groupId>org.dubhe.biz</groupId> | |||||
<artifactId>log</artifactId> | |||||
<version>${org.dubhe.biz.log.version}</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.springframework.boot</groupId> | |||||
<artifactId>spring-boot-starter-web</artifactId> | |||||
</dependency> | |||||
<!--springboot mail--> | |||||
<dependency> | |||||
<groupId>org.springframework.boot</groupId> | |||||
<artifactId>spring-boot-starter-mail</artifactId> | |||||
</dependency> | |||||
<!--mapStruct依赖--> | |||||
<dependency> | |||||
<groupId>org.mapstruct</groupId> | |||||
<artifactId>mapstruct-jdk8</artifactId> | |||||
<version>${mapstruct.version}</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.mapstruct</groupId> | |||||
<artifactId>mapstruct-processor</artifactId> | |||||
<version>${mapstruct.version}</version> | |||||
<scope>provided</scope> | |||||
</dependency> | |||||
<!--验证码--> | |||||
<dependency> | |||||
<groupId>com.github.whvcse</groupId> | |||||
<artifactId>easy-captcha</artifactId> | |||||
<version>${easy-captcha.version}</version> | |||||
</dependency> | |||||
<!-- recycle 垃圾回收--> | |||||
<dependency> | |||||
<groupId>org.dubhe</groupId> | |||||
<artifactId>common-recycle</artifactId> | |||||
<version>${org.dubhe.common-recycle.version}</version> | |||||
</dependency> | |||||
<!-- 单元测试 --> | |||||
<dependency> | |||||
<groupId>org.dubhe.cloud</groupId> | |||||
<artifactId>unit-test</artifactId> | |||||
<version>${org.dubhe.cloud.unit-test.version}</version> | |||||
<scope>test</scope> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.springframework.boot</groupId> | |||||
<artifactId>spring-boot-starter-test</artifactId> | |||||
<scope>test</scope> | |||||
</dependency> | |||||
</dependencies> | |||||
<build> | |||||
<plugins> | |||||
<plugin> | |||||
<groupId>org.springframework.boot</groupId> | |||||
<artifactId>spring-boot-maven-plugin</artifactId> | |||||
<configuration> | |||||
<skip>false</skip> | |||||
<fork>true</fork> | |||||
<classifier>exec</classifier> | |||||
</configuration> | |||||
</plugin> | |||||
<!-- 跳过单元测试 --> | |||||
<plugin> | |||||
<groupId>org.apache.maven.plugins</groupId> | |||||
<artifactId>maven-surefire-plugin</artifactId> | |||||
<configuration> | |||||
<skipTests>true</skipTests> | |||||
</configuration> | |||||
</plugin> | |||||
</plugins> | |||||
<resources> | |||||
<resource> | |||||
<filtering>true</filtering> | |||||
<directory>src/main/resources</directory> | |||||
</resource> | |||||
</resources> | |||||
</build> | |||||
</project> |
@@ -0,0 +1,34 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin; | |||||
import org.mybatis.spring.annotation.MapperScan; | |||||
import org.springframework.boot.SpringApplication; | |||||
import org.springframework.boot.autoconfigure.SpringBootApplication; | |||||
/** | |||||
* @description Admin启动类 | |||||
* @date 2020-12-02 | |||||
*/ | |||||
@SpringBootApplication(scanBasePackages = "org.dubhe") | |||||
@MapperScan(basePackages = {"org.dubhe.**.dao"}) | |||||
public class AdminApplication { | |||||
public static void main(String[] args) { | |||||
SpringApplication.run(AdminApplication.class, args); | |||||
} | |||||
} |
@@ -0,0 +1,54 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.client; | |||||
import org.dubhe.admin.client.fallback.AuthServiceFallback; | |||||
import org.dubhe.biz.base.constant.ApplicationNameConst; | |||||
import org.dubhe.biz.base.dto.Oauth2TokenDTO; | |||||
import org.dubhe.biz.base.vo.DataResponseBody; | |||||
import org.springframework.cloud.openfeign.FeignClient; | |||||
import org.springframework.web.bind.annotation.DeleteMapping; | |||||
import org.springframework.web.bind.annotation.PostMapping; | |||||
import org.springframework.web.bind.annotation.RequestParam; | |||||
import java.util.Map; | |||||
/** | |||||
* @description feign调用demo | |||||
* @date 2020-11-04 | |||||
*/ | |||||
@FeignClient(value = ApplicationNameConst.SERVER_AUTHORIZATION,fallback = AuthServiceFallback.class) | |||||
public interface AuthServiceClient { | |||||
/** | |||||
* 获取token | |||||
* | |||||
* @param parameters 获取token请求map | |||||
* @return token 信息 | |||||
*/ | |||||
@PostMapping(value = "/oauth/token") | |||||
DataResponseBody<Oauth2TokenDTO> postAccessToken(@RequestParam Map<String, String> parameters); | |||||
/** | |||||
* 登出 | |||||
* @param accessToken token | |||||
* @return | |||||
*/ | |||||
@DeleteMapping(value="/oauth/logout") | |||||
DataResponseBody<String> logout(@RequestParam("token")String accessToken); | |||||
} |
@@ -0,0 +1,55 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.client.fallback; | |||||
import org.dubhe.admin.client.AuthServiceClient; | |||||
import org.dubhe.biz.base.vo.DataResponseBody; | |||||
import org.dubhe.biz.dataresponse.factory.DataResponseFactory; | |||||
import org.springframework.stereotype.Component; | |||||
import java.util.Map; | |||||
/** | |||||
* @description Feign 熔断处理类 | |||||
* @date 2020-11-04 | |||||
*/ | |||||
@Component | |||||
public class AuthServiceFallback implements AuthServiceClient { | |||||
/** | |||||
* 获取token | |||||
* | |||||
* @param parameters 获取token请求map | |||||
* @return token 信息 | |||||
*/ | |||||
@Override | |||||
public DataResponseBody postAccessToken(Map<String, String> parameters) { | |||||
return DataResponseFactory.failed("call auth server postAccessToken error "); | |||||
} | |||||
/** | |||||
* 退出登录 | |||||
* | |||||
* @param accessToken token | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public DataResponseBody logout(String accessToken) { | |||||
return DataResponseFactory.failed("call auth server logout error "); | |||||
} | |||||
} |
@@ -0,0 +1,105 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.*; | |||||
import org.apache.ibatis.mapping.FetchType; | |||||
import org.dubhe.admin.domain.entity.*; | |||||
import java.util.List; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 权限组mapper接口 | |||||
* @date 2021-05-14 | |||||
*/ | |||||
public interface AuthCodeMapper extends BaseMapper<Auth> { | |||||
/** | |||||
* 根据角色id查询对应的权限组 | |||||
* | |||||
* @param queryWrapper role的wrapper对象 | |||||
* @return 角色集合 | |||||
*/ | |||||
@Select("select * from role ${ew.customSqlSegment}") | |||||
@Results(id = "roleMapperResults", | |||||
value = { | |||||
@Result(property = "id", column = "id"), | |||||
@Result(property = "auths", | |||||
column = "id", | |||||
many = @Many(select = "org.dubhe.admin.dao.AuthCodeMapper.selectByRoleId", fetchType = FetchType.LAZY))}) | |||||
List<Role> selectCollList(@Param("ew") Wrapper<Role> queryWrapper); | |||||
/** | |||||
* 给权限组绑定具体的权限 | |||||
* | |||||
* @param list 权限列表 | |||||
*/ | |||||
void tiedWithPermission(List<AuthPermission> list); | |||||
/** | |||||
* 清空指定权限组的权限 | |||||
* | |||||
* @param authId 权限组id | |||||
*/ | |||||
@Delete("delete from auth_permission where auth_id=#{authId} ") | |||||
void untiedWithPermission(Long authId); | |||||
@Delete("<script>" + | |||||
"delete from auth_permission where permission_id in" + | |||||
"<foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach>" + | |||||
"</script>") | |||||
void untiedByPermissionId(@Param("ids") Set<Long> ids); | |||||
/** | |||||
* 绑定角色权限 | |||||
* | |||||
* @param roleAuths 角色权限关联DTO | |||||
*/ | |||||
void tiedRoleAuth(List<RoleAuth> roleAuths); | |||||
/** | |||||
* 根据角色ID解绑角色权限 | |||||
* | |||||
* @param roleId 角色ID | |||||
*/ | |||||
@Update("delete from roles_auth where role_id = #{roleId}") | |||||
void untiedRoleAuthByRoleId(Long roleId); | |||||
/** | |||||
* 通过权限组id获取权限 | |||||
* | |||||
* @param authId 权限组id | |||||
* @return List<Permission> 权限列表 | |||||
*/ | |||||
@Select("select * from permission where id in (select permission_id from auth_permission where auth_id=#{authId}) and deleted=0 order by id") | |||||
List<Permission> getPermissionByAuthId(Long authId); | |||||
/** | |||||
* 根据角色id获取绑定的权限组列表 | |||||
* | |||||
* @param roleId 角色id | |||||
* @return 权限组列表 | |||||
*/ | |||||
@Select("select * from auth where id in (select auth_id from roles_auth where role_id=#{roleId}) and deleted=0") | |||||
List<Auth> selectByRoleId(long roleId); | |||||
} |
@@ -0,0 +1,59 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.apache.ibatis.annotations.Select; | |||||
import org.apache.ibatis.annotations.Update; | |||||
import org.dubhe.admin.domain.entity.DataSequence; | |||||
/** | |||||
* @description 数据序列 Mapper | |||||
* @date 2020-09-23 | |||||
*/ | |||||
public interface DataSequenceMapper extends BaseMapper<DataSequence> { | |||||
/** | |||||
* 根据业务编码查询序列 | |||||
* @param businessCode 业务编码 | |||||
* @return DataSequence 序号 | |||||
*/ | |||||
@Select("select id, business_code ,start, step from data_sequence where business_code = #{businessCode} for update") | |||||
DataSequence selectByBusiness(String businessCode); | |||||
/** | |||||
* 根据业务编码更新序列起始值 | |||||
* @param businessCode 业务编码 | |||||
* @return DataSequence 序号 | |||||
*/ | |||||
@Update("update data_sequence set start = start + step where business_code = #{businessCode} ") | |||||
int updateStartByBusinessCode(String businessCode); | |||||
/** | |||||
* 查询存在表的记录数 | |||||
* @param tableName 表名 | |||||
* @return int 查询表记录数 | |||||
*/ | |||||
@Select("select count(1) from ${tableName}") | |||||
int checkTableExist(@Param("tableName") String tableName); | |||||
/** | |||||
* 执行创建表 | |||||
* @param tableName 新表表名 | |||||
* @param oldTableName 模板表表名 | |||||
*/ | |||||
@Update({"CREATE TABLE ${tableName} like ${oldTableName}"}) | |||||
void createNewTable(@Param("tableName") String tableName, @Param("oldTableName") String oldTableName); | |||||
} |
@@ -0,0 +1,59 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Select; | |||||
import org.apache.ibatis.annotations.Update; | |||||
import org.dubhe.admin.domain.entity.DictDetail; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* @description 字典详情 mapper | |||||
* @date 2020-03-26 | |||||
*/ | |||||
public interface DictDetailMapper extends BaseMapper<DictDetail> { | |||||
/** | |||||
* 根据字典ID查找 | |||||
* | |||||
* @param dictId | |||||
* @return | |||||
*/ | |||||
@Select("select * from dict_detail where dict_id =#{dictId} order by sort") | |||||
List<DictDetail> selectByDictId(Serializable dictId); | |||||
/** | |||||
* 根据字典ID和标签查找 | |||||
* | |||||
* @param dictId | |||||
* @param label | |||||
* @return | |||||
*/ | |||||
@Select("select * from dict_detail where dict_id=#{dictId} and label=#{label}") | |||||
DictDetail selectByDictIdAndLabel(Serializable dictId, String label); | |||||
/** | |||||
* 根据字典ID删除 | |||||
* | |||||
* @param dictId | |||||
* @return | |||||
*/ | |||||
@Update("delete from dict_detail where dict_id =#{dictId}") | |||||
int deleteByDictId(Serializable dictId); | |||||
} |
@@ -0,0 +1,81 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import org.apache.ibatis.annotations.*; | |||||
import org.apache.ibatis.mapping.FetchType; | |||||
import org.dubhe.admin.domain.entity.Dict; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* @description 字典 mapper | |||||
* @date 2020-03-26 | |||||
*/ | |||||
public interface DictMapper extends BaseMapper<Dict> { | |||||
/** | |||||
* 查询实体及关联对象 | |||||
* | |||||
* @param queryWrapper 字典wrapper对象 | |||||
* @return 字典列表 | |||||
*/ | |||||
@Select("select * from dict ${ew.customSqlSegment}") | |||||
@Results(id = "dictMapperResults", | |||||
value = { | |||||
@Result(property = "id", column = "id"), | |||||
@Result(property = "dictDetails", | |||||
column = "id", | |||||
many = @Many(select = "org.dubhe.admin.dao.DictDetailMapper.selectByDictId", | |||||
fetchType = FetchType.LAZY))}) | |||||
List<Dict> selectCollList(@Param("ew") Wrapper<Dict> queryWrapper); | |||||
/** | |||||
* 分页查询实体及关联对象 | |||||
* | |||||
* @param page 分页对象 | |||||
* @param queryWrapper 字典wrapper对象 | |||||
* @return 分页字典集合 | |||||
*/ | |||||
@Select("select * from dict ${ew.customSqlSegment}") | |||||
@ResultMap(value = "dictMapperResults") | |||||
IPage<Dict> selectCollPage(Page<Dict> page, @Param("ew") Wrapper<Dict> queryWrapper); | |||||
/** | |||||
* 根据ID查询实体及关联对象 | |||||
* | |||||
* @param id 序列id | |||||
* @return 字典对象 | |||||
*/ | |||||
@Select("select * from dict where id=#{id}") | |||||
@ResultMap("dictMapperResults") | |||||
Dict selectCollById(Serializable id); | |||||
/** | |||||
* 根据Name查询实体及关联对象 | |||||
* | |||||
* @param name 字典名称 | |||||
* @return 字典对象 | |||||
*/ | |||||
@Select("select * from dict where name=#{name}") | |||||
@ResultMap("dictMapperResults") | |||||
Dict selectCollByName(String name); | |||||
} |
@@ -0,0 +1,45 @@ | |||||
/** | |||||
* Copyright 2019-2020 Zheng Jie | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Delete; | |||||
import org.apache.ibatis.annotations.Select; | |||||
import org.dubhe.admin.domain.entity.Log; | |||||
/** | |||||
* @description 获取一个时间段的IP记录 | |||||
* @date 2020-03-25 | |||||
*/ | |||||
public interface LogMapper extends BaseMapper<Log> { | |||||
/** | |||||
* 获取一个时间段的IP记录 | |||||
* | |||||
* @param date1 startTime | |||||
* @param date2 entTime | |||||
* @return IP数目 | |||||
*/ | |||||
@Select("select count(*) FROM (select request_ip FROM log where create_time between #{date1} and #{date2} GROUP BY request_ip) as s") | |||||
Long findIp(String date1, String date2); | |||||
/** | |||||
* 根据日志类型删除信息 | |||||
* | |||||
* @param logType 日志类型 | |||||
*/ | |||||
@Delete("delete from log where log_type = #{logType}") | |||||
void deleteByLogType(String logType); | |||||
} |
@@ -0,0 +1,83 @@ | |||||
/** | |||||
* Copyright 2019-2020 Zheng Jie | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.apache.ibatis.annotations.Select; | |||||
import org.apache.ibatis.annotations.SelectProvider; | |||||
import org.dubhe.admin.dao.provider.MenuProvider; | |||||
import org.dubhe.admin.domain.entity.Menu; | |||||
import org.dubhe.biz.base.dto.SysPermissionDTO; | |||||
import java.util.List; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 菜单 mapper | |||||
* @date 2020-04-02 | |||||
*/ | |||||
public interface MenuMapper extends BaseMapper<Menu> { | |||||
/** | |||||
* 根据角色id查询用户权限 | |||||
* | |||||
* @param roleIds 用户id | |||||
* @return 权限信息 | |||||
*/ | |||||
List<SysPermissionDTO> selectPermissionByRoleIds(@Param("list") List<Long> roleIds); | |||||
/** | |||||
* 根据组件名称查询 | |||||
* | |||||
* @param name 组件名称 | |||||
* @return 菜单对象 | |||||
*/ | |||||
@Select("select * from menu where component=#{name} and deleted = 0 ") | |||||
Menu findByComponentName(String name); | |||||
/** | |||||
* 根据菜单的 PID 查询 | |||||
* | |||||
* @param pid 菜单pid | |||||
* @return 菜单列表 | |||||
*/ | |||||
@Select("select * from menu where pid=#{pid} and deleted = 0 ") | |||||
List<Menu> findByPid(long pid); | |||||
/** | |||||
* 根据角色ID与菜单类型查询菜单 | |||||
* | |||||
* @param roleIds roleIDs | |||||
* @param type 类型 | |||||
* @return 菜单列表 | |||||
*/ | |||||
@SelectProvider(type = MenuProvider.class, method = "findByRolesIdInAndTypeNotOrderBySortAsc") | |||||
List<Menu> findByRolesIdInAndTypeNotOrderBySortAsc(Set<Long> roleIds, int type); | |||||
/** | |||||
* 根据角色ID与查询菜单 | |||||
* | |||||
* @param roleId 角色id | |||||
* @return 菜单列表 | |||||
*/ | |||||
@Select("select m.* from menu m,roles_menus rm where m.id= rm.menu_id and rm.role_id=#{roleId} and deleted = 0 ") | |||||
List<Menu> selectByRoleId(long roleId); | |||||
} |
@@ -0,0 +1,111 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Many; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.apache.ibatis.annotations.Result; | |||||
import org.apache.ibatis.annotations.Results; | |||||
import org.apache.ibatis.annotations.Select; | |||||
import org.apache.ibatis.annotations.Update; | |||||
import org.apache.ibatis.mapping.FetchType; | |||||
import org.dubhe.admin.domain.entity.Permission; | |||||
import org.dubhe.admin.domain.entity.Role; | |||||
import org.dubhe.biz.base.dto.SysPermissionDTO; | |||||
import java.util.List; | |||||
/** | |||||
* @description 角色权限关联mapper | |||||
* @date 2021-04-26 | |||||
*/ | |||||
public interface PermissionMapper extends BaseMapper<Permission> { | |||||
/** | |||||
* 查询实体及关联对象 | |||||
* | |||||
* @param queryWrapper 角色wrapper对象 | |||||
* @return 角色列表 | |||||
*/ | |||||
@Select("select * from role ${ew.customSqlSegment}") | |||||
@Results(id = "roleMapperResults", | |||||
value = { | |||||
@Result(property = "id", column = "id"), | |||||
@Result(property = "Permissions", | |||||
column = "id", | |||||
many = @Many(select = "org.dubhe.admin.dao.PermissionMapper.selectByRoleId", fetchType = FetchType.LAZY))}) | |||||
List<Role> selectCollList(@Param("ew") Wrapper<Role> queryWrapper); | |||||
/** | |||||
* 绑定角色权限 | |||||
* | |||||
* @param roleId 角色ID | |||||
* @param menuId 权限ID | |||||
*/ | |||||
@Update("insert into roles_auth values (#{roleId}, #{menuId})") | |||||
void tiedRoleAuth(Long roleId, Long menuId); | |||||
/** | |||||
* 根据roleId查询权限列表 | |||||
* | |||||
* @param roleId roleId | |||||
* @return List<Permission> 权限列表 | |||||
*/ | |||||
@Select("select p.permission, p.name from permission p left join auth_permission ap on p.id = ap.permission_id left join roles_auth ra on ap.auth_id = ra.auth_id where ra.role_id=#{roleId} and deleted=0 ") | |||||
List<Permission> selectByRoleId(long roleId); | |||||
/** | |||||
* 根据权限的 PID 查询 | |||||
* | |||||
* @param pid 父权限id | |||||
* @return List<Permission> 权限列表 | |||||
*/ | |||||
@Select("select * from permission where pid=#{pid} and deleted = 0 ") | |||||
List<Permission> findByPid(long pid); | |||||
/** | |||||
* 根据角色id查询用户权限 | |||||
* | |||||
* @param roleIds 用户id | |||||
* @return 权限信息 | |||||
*/ | |||||
List<SysPermissionDTO> selectPermissinByRoleIds(@Param("list") List<Long> roleIds); | |||||
/** | |||||
* 根据权限名获取权限信息 | |||||
* | |||||
* @param name 权限名称 | |||||
* @return 权限 | |||||
*/ | |||||
@Select("select * from permission where name=#{name} and deleted=0") | |||||
Permission findByName(String name); | |||||
} | |||||
@@ -0,0 +1,27 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.dubhe.admin.domain.entity.ResourceSpecs; | |||||
/** | |||||
* @description 资源规格管理mapper接口 | |||||
* @date 2021-05-27 | |||||
*/ | |||||
public interface ResourceSpecsMapper extends BaseMapper<ResourceSpecs> { | |||||
} |
@@ -0,0 +1,163 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import org.apache.ibatis.annotations.*; | |||||
import org.apache.ibatis.mapping.FetchType; | |||||
import org.dubhe.admin.dao.provider.RoleProvider; | |||||
import org.dubhe.admin.domain.entity.Role; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* @description 角色 mapper | |||||
* @date 2020-11-26 | |||||
*/ | |||||
public interface RoleMapper extends BaseMapper<Role> { | |||||
/** | |||||
* 根据用户id查询用户角色 | |||||
* | |||||
* @param userId 用户id | |||||
* @return 用户信息 | |||||
*/ | |||||
@Select("select sr.id, sr.name, sur.user_id from users_roles sur left join role sr on sr.id = sur.role_id where sur.user_id = #{userId} and sr.deleted = 0 ") | |||||
List<Role> selectRoleByUserId(@Param("userId") Long userId); | |||||
/** | |||||
* 查询实体及关联对象 | |||||
* | |||||
* @param queryWrapper 角色wrapper对象 | |||||
* @return List<Role> 角色列表 | |||||
*/ | |||||
@Select("select * from role ${ew.customSqlSegment}") | |||||
@Results(id = "roleMapperResults", | |||||
value = { | |||||
@Result(property = "id", column = "id"), | |||||
@Result(property = "menus", | |||||
column = "id", | |||||
many = @Many(select = "org.dubhe.admin.dao.MenuMapper.selectByRoleId", fetchType = FetchType.LAZY)), | |||||
@Result(property = "auths", | |||||
column = "id", | |||||
many = @Many(select = "org.dubhe.admin.dao.AuthCodeMapper.selectByRoleId", fetchType = FetchType.LAZY))}) | |||||
List<Role> selectCollList(@Param("ew") Wrapper<Role> queryWrapper); | |||||
/** | |||||
* 分页查询实体及关联对象 | |||||
* | |||||
* @param page 分页对象 | |||||
* @param queryWrapper 角色wrapper对象 | |||||
* @return IPage<Role> 分页角色集合 | |||||
*/ | |||||
@Select("select * from role ${ew.customSqlSegment}") | |||||
@ResultMap(value = "roleMapperResults") | |||||
IPage<Role> selectCollPage(Page<Role> page, @Param("ew") Wrapper<Role> queryWrapper); | |||||
/** | |||||
* 根据ID查询实体及关联对象 | |||||
* | |||||
* @param id 序列id | |||||
* @return 角色 | |||||
*/ | |||||
@Select("select * from role where id=#{id} and deleted = 0 ") | |||||
@ResultMap("roleMapperResults") | |||||
Role selectCollById(Serializable id); | |||||
/** | |||||
* 根据名称查询 | |||||
* | |||||
* @param name 角色名称 | |||||
* @return 角色 | |||||
*/ | |||||
@Select("select * from role where name = #{name} and deleted = 0 ") | |||||
Role findByName(String name); | |||||
/** | |||||
* 绑定用户角色 | |||||
* | |||||
* @param userId 用户ID | |||||
* @param roleId 角色ID | |||||
*/ | |||||
@Update("insert into users_roles values (#{userId}, #{roleId})") | |||||
void tiedUserRole(Long userId, Long roleId); | |||||
/** | |||||
* 根据用户ID解绑用户角色 | |||||
* | |||||
* @param userId 用户ID | |||||
*/ | |||||
@Update("delete from users_roles where user_id = #{userId}") | |||||
void untiedUserRoleByUserId(Long userId); | |||||
/** | |||||
* 根据角色ID解绑用户角色 | |||||
* | |||||
* @param roleId 角色ID | |||||
*/ | |||||
@Update("delete from users_roles where role_id = #{roleId}") | |||||
void untiedUserRoleByRoleId(Long roleId); | |||||
/** | |||||
* 绑定角色菜单 | |||||
* | |||||
* @param roleId 角色ID | |||||
* @param menuId 菜单ID | |||||
*/ | |||||
@Update("insert into roles_menus values (#{roleId}, #{menuId})") | |||||
void tiedRoleMenu(Long roleId, Long menuId); | |||||
/** | |||||
* 根据角色ID解绑角色菜单 | |||||
* | |||||
* @param roleId 角色ID | |||||
*/ | |||||
@Update("delete from roles_menus where role_id = #{roleId}") | |||||
void untiedRoleMenuByRoleId(Long roleId); | |||||
/** | |||||
* 根据菜单ID解绑角色菜单 | |||||
* | |||||
* @param menuId 菜单ID | |||||
*/ | |||||
@Update("delete from roles_menus where menu_id = #{menuId}") | |||||
void untiedRoleMenuByMenuId(Long menuId); | |||||
/** | |||||
* 根据用户ID查询角色 | |||||
* | |||||
* @param userId 用户ID | |||||
* @return List<Role> 角色列表 | |||||
*/ | |||||
@SelectProvider(type = RoleProvider.class, method = "findRolesByUserId") | |||||
List<Role> findRolesByUserId(Long userId); | |||||
/** | |||||
* 根据团队ID和用户ID查询角色 | |||||
* | |||||
* @param userId 用户ID | |||||
* @param teamId 团队ID | |||||
* @return List<Role> 角色列表 | |||||
*/ | |||||
@SelectProvider(type = RoleProvider.class, method = "findByUserIdAndTeamId") | |||||
List<Role> findByUserIdAndTeamId(Long userId, Long teamId); | |||||
} |
@@ -0,0 +1,58 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.*; | |||||
import org.apache.ibatis.mapping.FetchType; | |||||
import org.dubhe.admin.dao.provider.TeamProvider; | |||||
import org.dubhe.admin.domain.entity.Team; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* @description 团队 mapper | |||||
* @date 2020-03-25 | |||||
*/ | |||||
public interface TeamMapper extends BaseMapper<Team> { | |||||
/** | |||||
* 根据ID查询名称 | |||||
* | |||||
* @param userId 用户id | |||||
* @return List<Team> 团队列表 | |||||
*/ | |||||
@SelectProvider(type = TeamProvider.class, method = "findByUserId") | |||||
List<Team> findByUserId(Long userId); | |||||
/** | |||||
* 根据ID查询团队实体及关联对象 | |||||
* | |||||
* @param id 序列id | |||||
* @return 团队 | |||||
*/ | |||||
@Select("select * from team where id=#{id}") | |||||
@Results(id = "teamMapperResults", | |||||
value = { | |||||
@Result(column = "id", property = "teamUserList", | |||||
many = @Many(select = "org.dubhe.admin.dao.UserMapper.findByTeamId", | |||||
fetchType = FetchType.LAZY))}) | |||||
Team selectCollById(Serializable id); | |||||
} |
@@ -0,0 +1,26 @@ | |||||
/** | |||||
* Copyright 2019-2020 Zheng Jie | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.dubhe.admin.domain.entity.UserAvatar; | |||||
/** | |||||
* @description 用户头像 mapper | |||||
* @date 2020-03-25 | |||||
*/ | |||||
public interface UserAvatarMapper extends BaseMapper<UserAvatar> { | |||||
} |
@@ -0,0 +1,86 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Delete; | |||||
import org.apache.ibatis.annotations.Insert; | |||||
import org.apache.ibatis.annotations.Select; | |||||
import org.apache.ibatis.annotations.Update; | |||||
import org.dubhe.admin.domain.entity.Group; | |||||
import org.dubhe.admin.domain.entity.User; | |||||
import java.util.List; | |||||
/** | |||||
* @description 用户组mapper接口 | |||||
* @date 2021-05-08 | |||||
*/ | |||||
public interface UserGroupMapper extends BaseMapper<Group> { | |||||
/** | |||||
* 获取用户组成员信息 | |||||
* | |||||
* @param groupId 用户组id | |||||
* @return List<User> 用户列表 | |||||
*/ | |||||
@Select("select u.* from user u left join user_group gu on u.id = gu.user_id where gu.group_id=#{groupId} and deleted=0 ") | |||||
List<User> queryUserByGroupId(Long groupId); | |||||
/** | |||||
* 删除用户组 | |||||
* | |||||
* @param groupId 用户组id | |||||
*/ | |||||
@Update("update pt_group set deleted=1 where id=#{groupId} ") | |||||
void delUserGroupByGroupId(Long groupId); | |||||
/** | |||||
* 清空用户组成员 | |||||
* | |||||
* @param groupId 用户组id | |||||
*/ | |||||
@Delete("delete from user_group where group_id=#{groupId} ") | |||||
void delUserByGroupId(Long groupId); | |||||
/** | |||||
* 新增用户组成员 | |||||
* | |||||
* @param groupId 用户组id | |||||
* @param userId 用户id | |||||
*/ | |||||
@Insert("insert into user_group values (#{groupId},#{userId})") | |||||
void addUserWithGroup(Long groupId, Long userId); | |||||
/** | |||||
* 删除用户组成员 | |||||
* | |||||
* @param groupId 用户组id | |||||
* @param userId 用户id | |||||
*/ | |||||
@Delete("delete from user_group where group_id=#{groupId} and user_id=#{userId}") | |||||
void delUserWithGroup(Long groupId, Long userId); | |||||
/** | |||||
* 获取还未分组的用户 | |||||
* | |||||
* @return List<User> 用户组成员列表 | |||||
*/ | |||||
@Select("select * from user where id not in (select user_id from user_group) and deleted=0") | |||||
List<User> findUserWithOutGroup(); | |||||
} |
@@ -0,0 +1,147 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import org.apache.ibatis.annotations.Many; | |||||
import org.apache.ibatis.annotations.One; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.apache.ibatis.annotations.Result; | |||||
import org.apache.ibatis.annotations.ResultMap; | |||||
import org.apache.ibatis.annotations.Results; | |||||
import org.apache.ibatis.annotations.Select; | |||||
import org.apache.ibatis.annotations.Update; | |||||
import org.apache.ibatis.mapping.FetchType; | |||||
import org.dubhe.admin.domain.entity.User; | |||||
import java.util.Date; | |||||
import java.util.List; | |||||
import java.util.Set; | |||||
/** | |||||
* @description Demo服务mapper | |||||
* @date 2020-11-26 | |||||
*/ | |||||
public interface UserMapper extends BaseMapper<User> { | |||||
/** | |||||
* 根据ID查询实体及关联对象 | |||||
* | |||||
* @param id 用户id | |||||
* @return 用户 | |||||
*/ | |||||
@Select("select * from user where id=#{id} and deleted = 0") | |||||
@Results(id = "userMapperResults", | |||||
value = { | |||||
@Result(property = "id", column = "id"), | |||||
@Result(property = "roles", | |||||
column = "id", | |||||
many = @Many(select = "org.dubhe.admin.dao.RoleMapper.findRolesByUserId", | |||||
fetchType = FetchType.LAZY)), | |||||
@Result(property = "userAvatar", | |||||
column = "avatar_id", | |||||
one = @One(select = "org.dubhe.admin.dao.UserAvatarMapper.selectById", | |||||
fetchType = FetchType.LAZY))}) | |||||
User selectCollById(Long id); | |||||
/** | |||||
* 根据用户名查询 | |||||
* | |||||
* @param username 用户名 | |||||
* @return 用户 | |||||
*/ | |||||
@Select("select * from user where username=#{username} and deleted = 0") | |||||
@ResultMap(value = "userMapperResults") | |||||
User findByUsername(String username); | |||||
/** | |||||
* 根据邮箱查询 | |||||
* | |||||
* @param email 邮箱 | |||||
* @return 用户 | |||||
*/ | |||||
@Select("select * from user where email=#{email} and deleted = 0") | |||||
@ResultMap(value = "userMapperResults") | |||||
User findByEmail(String email); | |||||
/** | |||||
* 修改密码 | |||||
* | |||||
* @param username 用户名 | |||||
* @param pass 密码 | |||||
* @param lastPasswordResetTime 密码最后一次重置时间 | |||||
*/ | |||||
@Update("update user set password = #{pass} , last_password_reset_time = #{lastPasswordResetTime} where username = #{username}") | |||||
void updatePass(String username, String pass, Date lastPasswordResetTime); | |||||
/** | |||||
* 修改邮箱 | |||||
* | |||||
* @param username 用户名 | |||||
* @param email 邮箱 | |||||
*/ | |||||
@Update("update user set email = #{email} where username = #{username}") | |||||
void updateEmail(String username, String email); | |||||
/** | |||||
* 查找用户权限 | |||||
* | |||||
* @param userId 用户id | |||||
* @return 权限集合 | |||||
*/ | |||||
Set<String> queryPermissionByUserId(Long userId); | |||||
/** | |||||
* 查询实体及关联对象 | |||||
* | |||||
* @param queryWrapper 用户wrapper对象 | |||||
* @return 用户集合 | |||||
*/ | |||||
@Select("select * from user ${ew.customSqlSegment}") | |||||
@ResultMap(value = "userMapperResults") | |||||
List<User> selectCollList(@Param("ew") Wrapper<User> queryWrapper); | |||||
/** | |||||
* 分页查询实体及关联对象 | |||||
* | |||||
* @param page 分页对象 | |||||
* @param queryWrapper 用户wrapper对象 | |||||
* @return 分页user集合 | |||||
*/ | |||||
@Select("select * from user ${ew.customSqlSegment} order by id desc") | |||||
@ResultMap(value = "userMapperResults") | |||||
IPage<User> selectCollPage(Page<User> page, @Param("ew") Wrapper<User> queryWrapper); | |||||
/** | |||||
* 根据角色分页查询实体及关联对象 | |||||
* | |||||
* @param page 分页对象 | |||||
* @param queryWrapper 用户wrapper对象 | |||||
* @param roleId 角色id | |||||
* @return 分页用户集合 | |||||
*/ | |||||
@Select("select u.* from user u join users_roles ur on u.id=ur.user_id and ur.role_id=#{roleId} ${ew.customSqlSegment} order by u.id desc") | |||||
@ResultMap(value = "userMapperResults") | |||||
IPage<User> selectCollPageByRoleId(Page<User> page, @Param("ew") Wrapper<User> queryWrapper, Long roleId); | |||||
} |
@@ -0,0 +1,46 @@ | |||||
/** | |||||
* Copyright 2019-2020 Zheng Jie | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
package org.dubhe.admin.dao; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.dubhe.admin.domain.entity.UserRole; | |||||
import java.util.List; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 用户角色 mapper | |||||
* @date 2020-6-9 | |||||
*/ | |||||
public interface UserRoleMapper extends BaseMapper<UserRole> { | |||||
/** | |||||
* 批量删除用户 | |||||
* | |||||
* @param userIds 用户id集合 | |||||
*/ | |||||
void deleteByUserId(@Param("list") Set<Long> userIds); | |||||
/** | |||||
* 批量添加用户角色 | |||||
* | |||||
* @param userRoles 用户角色实体集合 | |||||
*/ | |||||
void insertBatchs(List<UserRole> userRoles); | |||||
} | |||||
@@ -0,0 +1,45 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao.provider; | |||||
import org.apache.ibatis.jdbc.SQL; | |||||
import java.util.Map; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 菜单sql构建类 | |||||
* @date 2020-04-02 | |||||
*/ | |||||
public class MenuProvider { | |||||
public String findByRolesIdInAndTypeNotOrderBySortAsc(Map<String, Object> para) { | |||||
Set<Long> roleIds = (Set) para.get("roleIds"); | |||||
int type = (int) para.get("type"); | |||||
StringBuffer roleIdsql = new StringBuffer("rm.role_id in (-1 "); | |||||
roleIds.forEach(id -> { | |||||
roleIdsql.append("," + id.toString()); | |||||
}); | |||||
roleIdsql.append(" )"); | |||||
return new SQL() {{ | |||||
SELECT_DISTINCT("m.*"); | |||||
FROM("menu m, roles_menus rm "); | |||||
WHERE(roleIdsql + " and m.id=rm.menu_id and m.deleted = 0 and m.type<>" + type); | |||||
ORDER_BY("pid, sort, id"); | |||||
}}.toString(); | |||||
} | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao.provider; | |||||
import java.util.Map; | |||||
/** | |||||
* @description 角色构建类 | |||||
* @date 2020-04-15 | |||||
*/ | |||||
public class RoleProvider { | |||||
public String findRolesByUserId(Long userId) { | |||||
StringBuffer sql = new StringBuffer("select r.* from role r, users_roles ur "); | |||||
sql.append(" where ur.user_id=#{userId} "); | |||||
sql.append(" and ur.role_id=r.id"); | |||||
sql.append(" and r.deleted = 0"); | |||||
return sql.toString(); | |||||
} | |||||
public String findByUserIdAndTeamId(Map<String, Object> para) { | |||||
StringBuffer sql = new StringBuffer("select r.* from role r, teams_users_roles tur "); | |||||
sql.append(" where tur.user_id=#{userId} "); | |||||
sql.append(" and tur.team_id=#{teamId} "); | |||||
sql.append(" and tur.role_id=r.id"); | |||||
sql.append(" and r.deleted = 0"); | |||||
return sql.toString(); | |||||
} | |||||
} |
@@ -0,0 +1,32 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao.provider; | |||||
/** | |||||
* @description 团队构建类 | |||||
* @date 2020-04-15 | |||||
*/ | |||||
public class TeamProvider { | |||||
public String findByUserId(Long userId) { | |||||
StringBuffer sql = new StringBuffer("select t.* from team t, teams_users_roles tur "); | |||||
sql.append(" where tur.user_id=#{userId} "); | |||||
sql.append(" and tur.team_id=t.id "); | |||||
return sql.toString(); | |||||
} | |||||
} |
@@ -0,0 +1,45 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.dao.provider; | |||||
/** | |||||
* @description 用户sql构建类 | |||||
* @date 2020-04-02 | |||||
*/ | |||||
public class UserProvider { | |||||
public String queryPermissionByUserId(Long userId) { | |||||
StringBuffer sql = new StringBuffer("select m.permission from menu m, users_roles ur, roles_menus rm "); | |||||
sql.append(" where ur.user_id = #{userId} and ur.role_id = rm.role_id and rm.menu_id = m.id and m.permission <> '' and m.deleted = 0 "); | |||||
return sql.toString(); | |||||
} | |||||
public String findPermissionByUserIdAndTeamId(Long userId, Long teamId) { | |||||
StringBuffer sql = new StringBuffer("select m.permission from menu m, teams_users_roles tur ,roles_menus rm "); | |||||
sql.append(" where tur.user_id=#{userId} "); | |||||
sql.append(" and tur.role_id=rm.role_id "); | |||||
sql.append(" and tur.team_id=#{team_id} "); | |||||
sql.append(" and rm.menu_id=m.id"); | |||||
sql.append(" and and m.deleted = 0 "); | |||||
return sql.toString(); | |||||
} | |||||
public String findByTeamId(Long teamId) { | |||||
StringBuffer sql = new StringBuffer("select u.* from user u,teams_users_roles tur where tur.team_id=#{teamId} and tur.user_id=u.id and u.deleted = 0"); | |||||
return sql.toString(); | |||||
} | |||||
} |
@@ -0,0 +1,47 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 创建权限组DTO | |||||
* @date 2021-05-14 | |||||
*/ | |||||
@Data | |||||
public class AuthCodeCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "autoCode", required = true) | |||||
@NotEmpty(message = "权限组code不能为空") | |||||
private String authCode; | |||||
@ApiModelProperty(value = "权限id集合", required = true) | |||||
@NotNull(message = "权限不能为空") | |||||
private Set<Long> permissions; | |||||
@ApiModelProperty("描述") | |||||
private String description; | |||||
} |
@@ -0,0 +1,36 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 删除权限组DTO | |||||
* @date 2021-05-17 | |||||
*/ | |||||
@Data | |||||
public class AuthCodeDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@NotNull(message = "id不能为空") | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,37 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.base.PageQueryBase; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 分页查看权限组列表 | |||||
* @date 2021-05-14 | |||||
*/ | |||||
@Data | |||||
public class AuthCodeQueryDTO extends PageQueryBase implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "权限组名称") | |||||
private String authCode; | |||||
} |
@@ -0,0 +1,46 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 修改权限组DTO | |||||
* @date 2021-05-14 | |||||
*/ | |||||
@Data | |||||
public class AuthCodeUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
private Long id; | |||||
@ApiModelProperty(value = "autoCode", required = true) | |||||
@NotEmpty(message = "权限组code不能为空") | |||||
private String authCode; | |||||
@ApiModelProperty(value = "权限id集合") | |||||
private Set<Long> permissions; | |||||
@ApiModelProperty("描述") | |||||
private String description; | |||||
} |
@@ -0,0 +1,39 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 修改权限组权限DTO | |||||
* @date 2021-05-14 | |||||
*/ | |||||
@Data | |||||
public class AuthPermissionUpdDTO implements Serializable { | |||||
@ApiModelProperty(value = "权限组id") | |||||
@NotNull(message = "权限组id不能为空") | |||||
private Long authId; | |||||
@ApiModelProperty(value = "权限id集合") | |||||
private Set<Long> permissionIds; | |||||
} |
@@ -0,0 +1,71 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Permission; | |||||
import javax.validation.constraints.Size; | |||||
import java.io.Serializable; | |||||
import java.util.Objects; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 修改操作权限DTO | |||||
* @date 2021-04-28 | |||||
*/ | |||||
@Data | |||||
public class AuthUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
private Long id; | |||||
@ApiModelProperty(value = "操作权限名称") | |||||
@Size(max = 255, message = "名称长度不能超过255") | |||||
private String name; | |||||
@ApiModelProperty(value = "操作权限标识") | |||||
@Size(max = 255, message = "默认权限长度不能超过255") | |||||
private String permission; | |||||
private Set<Permission> permissions; | |||||
private Boolean deleted; | |||||
@Override | |||||
public boolean equals(Object o) { | |||||
if (this == o) { | |||||
return true; | |||||
} | |||||
if (o == null || getClass() != o.getClass()) { | |||||
return false; | |||||
} | |||||
AuthUpdateDTO role = (AuthUpdateDTO) o; | |||||
return Objects.equals(id, role.id); | |||||
} | |||||
@Override | |||||
public int hashCode() { | |||||
return Objects.hash(id); | |||||
} | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,48 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Getter; | |||||
import lombok.Setter; | |||||
import javax.validation.constraints.NotBlank; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 用户登录dto | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Getter | |||||
@Setter | |||||
public class AuthUserDTO implements Serializable { | |||||
private static final long serialVersionUID = 6243696246160576285L; | |||||
@NotBlank | |||||
private String username; | |||||
@NotBlank | |||||
private String password; | |||||
private String code; | |||||
private String uuid = ""; | |||||
@Override | |||||
public String toString() { | |||||
return "{username=" + username + ", password= ******}"; | |||||
} | |||||
} |
@@ -0,0 +1,51 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.DictDetail; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.NotBlank; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 字典新增DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class DictCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = -901581636964448858L; | |||||
@NotBlank(message = "字典名称不能为空") | |||||
@Length(max = 255, message = "名称长度不能超过255") | |||||
private String name; | |||||
@Length(max = 255, message = "备注长度不能超过255") | |||||
private String remark; | |||||
private Timestamp createTime; | |||||
@TableField(exist = false) | |||||
private List<DictDetail> dictDetails; | |||||
} |
@@ -0,0 +1,42 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 字典DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class DictDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
private Long id; | |||||
private String name; | |||||
private String remark; | |||||
private List<DictDetailDTO> dictDetails; | |||||
private Timestamp createTime; | |||||
} |
@@ -0,0 +1,36 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 字典删除DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class DictDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = 6346677566514471535L; | |||||
@NotEmpty(message = "id不能为空") | |||||
Set<Long> ids; | |||||
} |
@@ -0,0 +1,53 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
/** | |||||
* @description 字典详情修改DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class DictDetailCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = -1936563127368448645L; | |||||
@ApiModelProperty(value = "字典标签") | |||||
@Length(max = 255, message = "字典标签长度不能超过255") | |||||
private String label; | |||||
@ApiModelProperty(value = "字典值") | |||||
@Length(max = 255, message = "字典值长度不能超过255") | |||||
private String value; | |||||
@ApiModelProperty(value = "排序") | |||||
private String sort = "999"; | |||||
private Long dictId; | |||||
private Timestamp createTime; | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,53 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
/** | |||||
* @description 字典详情DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class DictDetailDTO implements Serializable { | |||||
private static final long serialVersionUID = 1521993584428225098L; | |||||
@ApiModelProperty(value = "字典详情id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "字典label") | |||||
private String label; | |||||
@ApiModelProperty(value = "字典详情value") | |||||
private String value; | |||||
@ApiModelProperty(value = "排序") | |||||
private String sort; | |||||
@ApiModelProperty(value = "字典id") | |||||
private Long dictId; | |||||
private Timestamp createTime; | |||||
private Timestamp updateTime; | |||||
} |
@@ -0,0 +1,38 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 字典详情删除DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class DictDetailDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = -151060582445500836L; | |||||
@NotEmpty(message = "id不能为空") | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,38 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.annotation.Query; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 字典详情查询实体 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class DictDetailQueryDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@Query(type = Query.Type.LIKE) | |||||
private String label; | |||||
@Query(propName = "dict_id", type = Query.Type.EQ) | |||||
private Long dictId; | |||||
} |
@@ -0,0 +1,60 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.DictDetail; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
/** | |||||
* @description 字典详情修改DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class DictDetailUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = -1936563127368448645L; | |||||
@NotNull(groups = DictDetail.Update.class) | |||||
private Long id; | |||||
@ApiModelProperty(value = "字典标签") | |||||
@Length(max = 255, message = "字典标签长度不能超过255") | |||||
private String label; | |||||
@ApiModelProperty(value = "字典值") | |||||
@Length(max = 255, message = "字典值长度不能超过255") | |||||
private String value; | |||||
@ApiModelProperty(value = "排序") | |||||
private String sort = "999"; | |||||
@ApiModelProperty(value = "字典id") | |||||
private Long dictId; | |||||
private Timestamp createTime; | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,35 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.annotation.Query; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 公共查询类 | |||||
* @date 2020-05-10 | |||||
*/ | |||||
@Data | |||||
public class DictQueryDTO implements Serializable { | |||||
private static final long serialVersionUID = -8221913871799888949L; | |||||
@Query(blurry = "name,remark") | |||||
private String blurry; | |||||
} |
@@ -0,0 +1,32 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 实体类 | |||||
* @date 2020-03-16 | |||||
*/ | |||||
@Data | |||||
public class DictSmallDTO implements Serializable { | |||||
private Long id; | |||||
private String name; | |||||
} |
@@ -0,0 +1,33 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 字典查询转换DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class DictSmallQueryDTO implements Serializable { | |||||
private static final long serialVersionUID = 5825111154262768118L; | |||||
private Long id; | |||||
private String name; | |||||
} |
@@ -0,0 +1,58 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Dict; | |||||
import org.dubhe.admin.domain.entity.DictDetail; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 字典新增DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class DictUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = -901581636964448858L; | |||||
@NotNull(groups = Dict.Update.class) | |||||
private Long id; | |||||
@NotBlank | |||||
@Length(max = 255, message = "名称长度不能超过255") | |||||
private String name; | |||||
@Length(max = 255, message = "备注长度不能超过255") | |||||
private String remark; | |||||
private Timestamp createTime; | |||||
@TableField(exist = false) | |||||
private List<DictDetail> dictDetails; | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,48 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
/** | |||||
* @description 邮件DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public class EmailDTO { | |||||
@ApiModelProperty(value = "邮箱地址") | |||||
String receiverMailAddress; | |||||
@ApiModelProperty(value = "标题") | |||||
String subject; | |||||
@ApiModelProperty(value = "验证码") | |||||
String code; | |||||
@ApiModelProperty(value = "类型 1 用户注册 2 修改邮箱 3 其他") | |||||
Integer type; | |||||
} |
@@ -0,0 +1,37 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.*; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 扩展配置DTO | |||||
* @date 2021-01-25 | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
@NoArgsConstructor | |||||
@AllArgsConstructor | |||||
public class ExtConfigDTO implements Serializable { | |||||
@ApiModelProperty(value = "返回上一级菜单") | |||||
private String backTo; | |||||
} |
@@ -0,0 +1,50 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
/** | |||||
* @description 日志转换DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class LogDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
private Long id; | |||||
private String username; | |||||
private String description; | |||||
private String method; | |||||
private String params; | |||||
private String browser; | |||||
private String requestIp; | |||||
private String address; | |||||
private Timestamp createTime; | |||||
} |
@@ -0,0 +1,41 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.annotation.Query; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 日志查询类 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class LogQueryDTO { | |||||
@Query(blurry = "username,requestIp,method,params") | |||||
private String blurry; | |||||
@Query | |||||
private String logType; | |||||
@Query(type = Query.Type.BETWEEN) | |||||
private List<Timestamp> createTime; | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
/** | |||||
* @description 实体类 | |||||
* @date 2020-03-16 | |||||
*/ | |||||
@Data | |||||
public class LogSmallDTO implements Serializable { | |||||
private String description; | |||||
private String requestIp; | |||||
private Long time; | |||||
private String address; | |||||
private String browser; | |||||
private Timestamp createTime; | |||||
} |
@@ -0,0 +1,94 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.Size; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 菜单新增 dto | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class MenuCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = 3587665050240667198L; | |||||
@NotBlank | |||||
private String name; | |||||
private Long sort = 999L; | |||||
@Size(max = 255, message = "路由地址长度不能超过255") | |||||
private String path; | |||||
@Size(max = 255, message = "路径长度不能超过255") | |||||
private String component; | |||||
/** | |||||
* 类型,目录、菜单、按钮 | |||||
*/ | |||||
private Integer type; | |||||
/** | |||||
* 权限 | |||||
*/ | |||||
@Size(max = 255, message = "权限长度不能超过255") | |||||
private String permission; | |||||
private String componentName; | |||||
@Size(max = 255, message = "图标长度不能超过255") | |||||
private String icon; | |||||
/** | |||||
* 布局类型 | |||||
*/ | |||||
@Size(max = 255, message = "布局类型不能超过255") | |||||
private String layout; | |||||
private Boolean cache; | |||||
private Boolean hidden; | |||||
/** | |||||
* 上级菜单ID | |||||
*/ | |||||
private Long pid; | |||||
private Boolean deleted; | |||||
/** | |||||
* 回到上一级 | |||||
*/ | |||||
private String backTo; | |||||
/** | |||||
* 扩展配置 | |||||
*/ | |||||
@Size(max = 255, message = "扩展配置长度不能超过255") | |||||
private String extConfig; | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,82 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 字典查询转换DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class MenuDTO implements Serializable { | |||||
private Long id; | |||||
@ApiModelProperty(value = "菜单类型: 0目录,1页面,2权限,3外链") | |||||
private Integer type; | |||||
@ApiModelProperty(value = "权限标识") | |||||
private String permission; | |||||
@ApiModelProperty(value = "名称") | |||||
private String name; | |||||
@ApiModelProperty(value = "菜单排序") | |||||
private Long sort; | |||||
@ApiModelProperty(value = "路径或外链URL") | |||||
private String path; | |||||
@ApiModelProperty(value = "组件路径") | |||||
private String component; | |||||
@ApiModelProperty(value = "上级菜单ID") | |||||
private Long pid; | |||||
@ApiModelProperty(value = "路由缓存 keep-alive") | |||||
private Boolean cache; | |||||
@ApiModelProperty(value = "菜单栏不显示") | |||||
private Boolean hidden; | |||||
@ApiModelProperty(value = "路由名称") | |||||
private String componentName; | |||||
@ApiModelProperty(value = "菜单图标") | |||||
private String icon; | |||||
@ApiModelProperty(value = "页面布局类型") | |||||
private String layout; | |||||
private List<MenuDTO> children; | |||||
private Timestamp createTime; | |||||
@ApiModelProperty(value = "回到上一级") | |||||
private String backTo; | |||||
@ApiModelProperty(value = "扩展配置") | |||||
private String extConfig; | |||||
} |
@@ -0,0 +1,38 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 菜单删除 dto | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class MenuDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = -6599428238298923816L; | |||||
@NotEmpty(message = "id不能为空") | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.annotation.Query; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 菜单查询实体类 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class MenuQueryDTO { | |||||
@Query(blurry = "name,path,component_name") | |||||
private String blurry; | |||||
@Query(propName = "create_time", type = Query.Type.BETWEEN) | |||||
private List<Timestamp> createTime; | |||||
@Query(propName = "deleted", type = Query.Type.EQ) | |||||
private Boolean deleted = false; | |||||
} |
@@ -0,0 +1,117 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Menu; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
import javax.validation.constraints.Size; | |||||
import java.io.Serializable; | |||||
import java.util.Objects; | |||||
/** | |||||
* @description 菜单修改 dto | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class MenuUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 3587665050240667198L; | |||||
@NotNull(groups = {Menu.Update.class}) | |||||
private Long id; | |||||
@NotBlank | |||||
private String name; | |||||
private Long sort = 999L; | |||||
@Size(max = 255, message = "路由地址长度不能超过255") | |||||
private String path; | |||||
@Size(max = 255, message = "路径长度不能超过255") | |||||
private String component; | |||||
/** | |||||
* 类型,目录、菜单、按钮 | |||||
*/ | |||||
private Integer type; | |||||
/** | |||||
* 权限 | |||||
*/ | |||||
@Size(max = 255, message = "权限长度不能超过255") | |||||
private String permission; | |||||
private String componentName; | |||||
@Size(max = 255, message = "图标长度不能超过255") | |||||
private String icon; | |||||
/** | |||||
* 布局类型 | |||||
*/ | |||||
@Size(max = 255, message = "布局类型不能超过255") | |||||
private String layout; | |||||
private Boolean cache; | |||||
private Boolean hidden; | |||||
/** | |||||
* 上级菜单ID | |||||
*/ | |||||
private Long pid; | |||||
private Boolean deleted; | |||||
/** | |||||
* 回到上一级 | |||||
*/ | |||||
private String backTo; | |||||
/** | |||||
* 扩展配置 | |||||
*/ | |||||
@Size(max = 255, message = "扩展配置长度不能超过255") | |||||
private String extConfig; | |||||
@Override | |||||
public boolean equals(Object o) { | |||||
if (this == o) { | |||||
return true; | |||||
} | |||||
if (o == null || getClass() != o.getClass()) { | |||||
return false; | |||||
} | |||||
MenuUpdateDTO menu = (MenuUpdateDTO) o; | |||||
return Objects.equals(id, menu.id); | |||||
} | |||||
@Override | |||||
public int hashCode() { | |||||
return Objects.hash(id); | |||||
} | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,72 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.util.List; | |||||
/** | |||||
* @description 节点实体类 | |||||
* @date 2020-06-03 | |||||
*/ | |||||
@Data | |||||
public class NodeDTO { | |||||
@ApiModelProperty(value = "node节点id值") | |||||
private String uid; | |||||
@ApiModelProperty(value = "node节点名称") | |||||
private String name; | |||||
@ApiModelProperty(value = "node节点ip地址") | |||||
private String ip; | |||||
@ApiModelProperty(value = "node节点状态") | |||||
private String status; | |||||
@ApiModelProperty(value = "gpu总数") | |||||
private String gpuCapacity; | |||||
@ApiModelProperty(value = "gpu可用数") | |||||
private String gpuAvailable; | |||||
@ApiModelProperty(value = "创建字段保存gpu使用数") | |||||
private String gpuUsed; | |||||
@ApiModelProperty(value = "保存节点信息") | |||||
private List<PodDTO> pods; | |||||
@ApiModelProperty(value = "node节点的使用内存") | |||||
private String nodeMemory; | |||||
@ApiModelProperty(value = "node节点的使用cpu") | |||||
private String nodeCpu; | |||||
@ApiModelProperty(value = "node节点的总的cpu") | |||||
private String totalNodeCpu; | |||||
@ApiModelProperty(value = "node节点的总的内存") | |||||
private String totalNodeMemory; | |||||
@ApiModelProperty(value = "node节点的警告") | |||||
private String warning; | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Permission; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* @description 新增权限DTO | |||||
* @date 2021-05-31 | |||||
*/ | |||||
@Data | |||||
public class PermissionCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "权限父id") | |||||
@NotNull(message = "父级权限id不能为空") | |||||
private Long pid; | |||||
@NotEmpty(message = "权限不能为空") | |||||
private List<Permission> permissions; | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 操作权限DTO | |||||
* @date 2021-04-29 | |||||
*/ | |||||
@Data | |||||
public class PermissionDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "权限id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "父权限id") | |||||
private Long pid; | |||||
@ApiModelProperty("权限标识") | |||||
private String permission; | |||||
@ApiModelProperty(value = "权限名称") | |||||
private String name; | |||||
} |
@@ -0,0 +1,34 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 删除权限DTO | |||||
* @date 2021-05-31 | |||||
*/ | |||||
@Data | |||||
public class PermissionDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,33 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 权限查询DTO | |||||
* @date 2021-05-31 | |||||
*/ | |||||
@Data | |||||
public class PermissionQueryDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
private String keyword; | |||||
} |
@@ -0,0 +1,47 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Permission; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.List; | |||||
/** | |||||
* @description 修改权限DTO | |||||
* @date 2021-06-01 | |||||
*/ | |||||
@Data | |||||
public class PermissionUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "权限id") | |||||
@NotNull(message = "权限id不能为空") | |||||
private Long id; | |||||
@ApiModelProperty(value = "权限父id") | |||||
@NotNull(message = "父级权限id不能为空") | |||||
private Long pid; | |||||
@NotEmpty(message = "权限不能为空") | |||||
private List<Permission> permissions; | |||||
} |
@@ -0,0 +1,52 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
/** | |||||
* @description pod的实体类 | |||||
* @date 2020-06-03 | |||||
*/ | |||||
@Data | |||||
public class PodDTO { | |||||
@ApiModelProperty(value = "pod的name") | |||||
private String podName; | |||||
@ApiModelProperty(value = "pod的内存") | |||||
private String podMemory; | |||||
@ApiModelProperty(value = "pod的cpu") | |||||
private String podCpu; | |||||
@ApiModelProperty(value = "pod的显卡") | |||||
private String podCard; | |||||
@ApiModelProperty(value = "pod的状态") | |||||
private String status; | |||||
@ApiModelProperty(value = "node的name") | |||||
private String nodeName; | |||||
@ApiModelProperty(value = "pod的创建时间") | |||||
private String podCreateTime; | |||||
} |
@@ -0,0 +1,74 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import org.dubhe.biz.base.constant.MagicNumConstant; | |||||
import org.dubhe.biz.base.constant.StringConstant; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.*; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 资源规格创建 | |||||
* @date 2021-05-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
public class ResourceSpecsCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "规格名称", required = true) | |||||
@NotBlank(message = "规格名称不能为空") | |||||
@Length(max = MagicNumConstant.THIRTY_TWO, message = "规格名称错误-输入长度不能超过32个字符") | |||||
@Pattern(regexp = StringConstant.REGEXP_SPECS, message = "规格名称支持字母、数字、汉字、英文横杠、下划线和空白字符") | |||||
private String specsName; | |||||
@ApiModelProperty(value = "所属业务场景(0:通用,1:dubhe-notebook,2:dubhe-train,3:dubhe-serving)", required = true) | |||||
@NotNull(message = "所属业务场景不能为空") | |||||
@Min(value = MagicNumConstant.ZERO, message = "所属业务场景错误") | |||||
@Max(value = MagicNumConstant.THREE, message = "所属业务场景错误") | |||||
private Integer module; | |||||
@ApiModelProperty(value = "CPU数量,单位:核", required = true) | |||||
@NotNull(message = "CPU数量不能为空") | |||||
@Min(value = MagicNumConstant.ZERO, message = "CPU数量不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "CPU数量超限") | |||||
private Integer cpuNum; | |||||
@ApiModelProperty(value = "GPU数量,单位:核", required = true) | |||||
@NotNull(message = "GPU数量不能为空") | |||||
@Min(value = MagicNumConstant.ZERO, message = "GPU数量不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "GPU数量超限") | |||||
private Integer gpuNum; | |||||
@ApiModelProperty(value = "内存大小,单位:M", required = true) | |||||
@NotNull(message = "内存数值不能为空") | |||||
@Min(value = MagicNumConstant.ZERO, message = "内存不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "内存数值超限") | |||||
private Integer memNum; | |||||
@ApiModelProperty(value = "工作空间的存储配额,单位:M", required = true) | |||||
@NotNull(message = "工作空间的存储配额不能为空") | |||||
@Min(value = MagicNumConstant.ZERO, message = "工作空间的存储配额不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "工作空间的存储配额超限") | |||||
private Integer workspaceRequest; | |||||
} |
@@ -0,0 +1,40 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 资源规格删除 | |||||
* @date 2021-05-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
public class ResourceSpecsDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "id", required = true) | |||||
@NotNull(message = "id不能为空") | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,51 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import org.dubhe.biz.base.constant.MagicNumConstant; | |||||
import org.dubhe.biz.db.base.PageQueryBase; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.Max; | |||||
import javax.validation.constraints.Min; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 查询资源规格 | |||||
* @date 2021-05-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
public class ResourceSpecsQueryDTO extends PageQueryBase implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty("规格名称") | |||||
@Length(max = MagicNumConstant.THIRTY_TWO, message = "规格名称错误") | |||||
private String specsName; | |||||
@ApiModelProperty("规格类型(0为CPU, 1为GPU)") | |||||
private Boolean resourcesPoolType; | |||||
@ApiModelProperty("所属业务场景(0:通用,1:dubhe-notebook,2:dubhe-train,3:dubhe-serving)") | |||||
@Min(value = MagicNumConstant.ZERO, message = "所属业务场景错误") | |||||
@Max(value = MagicNumConstant.THREE, message = "所属业务场景错误") | |||||
private Integer module; | |||||
} |
@@ -0,0 +1,77 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import org.dubhe.biz.base.constant.MagicNumConstant; | |||||
import org.dubhe.biz.base.constant.StringConstant; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.Max; | |||||
import javax.validation.constraints.Min; | |||||
import javax.validation.constraints.NotNull; | |||||
import javax.validation.constraints.Pattern; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 资源规格修改 | |||||
* @date 2021-05-27 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
public class ResourceSpecsUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "id", required = true) | |||||
@NotNull(message = "id不能为null") | |||||
@Min(value = MagicNumConstant.ONE, message = "id必须大于1") | |||||
private Long id; | |||||
@ApiModelProperty(value = "规格名称") | |||||
@Length(max = MagicNumConstant.THIRTY_TWO, message = "规格名称错误-输入长度不能超过32个字符") | |||||
@Pattern(regexp = StringConstant.REGEXP_SPECS, message = "规格名称支持字母、数字、汉字、英文横杠、下划线和空白字符") | |||||
private String specsName; | |||||
@ApiModelProperty(value = "所属业务场景(0:通用,1:dubhe-notebook,2:dubhe-train,3:dubhe-serving)", required = true) | |||||
@NotNull(message = "所属业务场景不能为空") | |||||
@Min(value = MagicNumConstant.ZERO, message = "所属业务场景错误") | |||||
@Max(value = MagicNumConstant.THREE, message = "所属业务场景错误") | |||||
private Integer module; | |||||
@ApiModelProperty(value = "CPU数量,单位:核") | |||||
@Min(value = MagicNumConstant.ZERO, message = "CPU数量不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "CPU数量超限") | |||||
private Integer cpuNum; | |||||
@ApiModelProperty(value = "GPU数量,单位:核") | |||||
@Min(value = MagicNumConstant.ZERO, message = "GPU数量不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "GPU数量超限") | |||||
private Integer gpuNum; | |||||
@ApiModelProperty(value = "内存大小,单位:M") | |||||
@Min(value = MagicNumConstant.ZERO, message = "内存不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "内存数值超限") | |||||
private Integer memNum; | |||||
@ApiModelProperty(value = "工作空间的存储配额,单位:M") | |||||
@Min(value = MagicNumConstant.ZERO, message = "工作空间的存储配额不能小于0") | |||||
@Max(value = MagicNumConstant.TWO_BILLION, message = "工作空间的存储配额超限") | |||||
private Integer workspaceRequest; | |||||
} |
@@ -0,0 +1,39 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description | |||||
* @date 2021-05-17 | |||||
*/ | |||||
@Data | |||||
public class RoleAuthUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@NotNull(message = "角色id不能为空") | |||||
private Long roleId; | |||||
@NotNull(message = "权限组id不能为空") | |||||
private Set<Long> authIds; | |||||
} |
@@ -0,0 +1,55 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Menu; | |||||
import javax.validation.constraints.Size; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 角色创建 DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class RoleCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = -8685787591892312697L; | |||||
private Long id; | |||||
@Size(max = 255, message = "名称长度不能超过255") | |||||
private String name; | |||||
/** | |||||
* 权限 | |||||
*/ | |||||
@Size(max = 255, message = "默认权限长度不能超过255") | |||||
private String permission; | |||||
@Size(max = 255, message = "备注长度不能超过255") | |||||
private String remark; | |||||
private Set<Menu> menus; | |||||
private Boolean deleted; | |||||
} |
@@ -0,0 +1,48 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.vo.AuthVO; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 角色的实体类 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class RoleDTO implements Serializable { | |||||
private static final long serialVersionUID = -7250301719333643312L; | |||||
private Long id; | |||||
private String name; | |||||
private String remark; | |||||
private String permission; | |||||
private Set<MenuDTO> menus; | |||||
private Set<AuthVO> auths; | |||||
private Timestamp createTime; | |||||
} |
@@ -0,0 +1,38 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 角色删除 dto | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class RoleDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = -6599428238298923816L; | |||||
@NotEmpty(message = "角色id不能为空") | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,44 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.annotation.Query; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 角色请求实体DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class RoleQueryDTO implements Serializable { | |||||
private static final long serialVersionUID = 1266792048261542801L; | |||||
@Query(blurry = "name,remark") | |||||
private String blurry; | |||||
@Query(propName = "create_time", type = Query.Type.BETWEEN) | |||||
private List<Timestamp> createTime; | |||||
@Query(propName = "deleted", type = Query.Type.EQ) | |||||
private Boolean deleted = false; | |||||
} |
@@ -0,0 +1,35 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 角色的实体转换 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class RoleSmallDTO implements Serializable { | |||||
private static final long serialVersionUID = -6601893040730122984L; | |||||
private Long id; | |||||
private String name; | |||||
} |
@@ -0,0 +1,75 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Menu; | |||||
import javax.validation.constraints.Size; | |||||
import java.io.Serializable; | |||||
import java.util.Objects; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 角色修改 DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class RoleUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = -8685787591892312697L; | |||||
private Long id; | |||||
@Size(max = 255, message = "名称长度不能超过255") | |||||
private String name; | |||||
/** | |||||
* 权限 | |||||
*/ | |||||
@Size(max = 255, message = "默认权限长度不能超过255") | |||||
private String permission; | |||||
@Size(max = 255, message = "备注长度不能超过255") | |||||
private String remark; | |||||
private Set<Menu> menus; | |||||
private Boolean deleted; | |||||
@Override | |||||
public boolean equals(Object o) { | |||||
if (this == o) { | |||||
return true; | |||||
} | |||||
if (o == null || getClass() != o.getClass()) { | |||||
return false; | |||||
} | |||||
RoleUpdateDTO role = (RoleUpdateDTO) o; | |||||
return Objects.equals(id, role.id); | |||||
} | |||||
@Override | |||||
public int hashCode() { | |||||
return Objects.hash(id); | |||||
} | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,52 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.User; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 团队创建实体 | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class TeamCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = 8922409236439269071L; | |||||
@NotBlank | |||||
private String name; | |||||
@NotNull | |||||
private Boolean enabled; | |||||
/** | |||||
* 团队成员 | |||||
*/ | |||||
private List<User> teamUserList; | |||||
private Timestamp createTime; | |||||
} |
@@ -0,0 +1,50 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.annotation.Query; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 团队查询DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class TeamQueryDTO implements Serializable { | |||||
private static final long serialVersionUID = 700075706114767404L; | |||||
@Query(type = Query.Type.IN, propName = "id") | |||||
private Set<Long> ids; | |||||
@Query(type = Query.Type.LIKE) | |||||
private String name; | |||||
@Query | |||||
private Boolean enabled; | |||||
@Query | |||||
private Long pid; | |||||
@Query(propName = "create_time", type = Query.Type.BETWEEN) | |||||
private List<Timestamp> createTime; | |||||
} |
@@ -0,0 +1,55 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.User; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class TeamUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 8922409236439269071L; | |||||
@NotNull | |||||
private Long id; | |||||
@NotBlank | |||||
private String name; | |||||
@NotNull | |||||
private Boolean enabled; | |||||
/** | |||||
* 团队成员 | |||||
*/ | |||||
private List<User> teamUserList; | |||||
private Timestamp createTime; | |||||
} |
@@ -0,0 +1,33 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 团队用户角色DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class TeamUserRoleSmallDTO implements Serializable { | |||||
private static final long serialVersionUID = 6589829002637730619L; | |||||
private Long id; | |||||
private RoleSmallDTO role; | |||||
} |
@@ -0,0 +1,34 @@ | |||||
/** | |||||
* Copyright 2019-2020 Zheng Jie | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.Size; | |||||
/** | |||||
* @description 修改头像 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class UserAvatarUpdateDTO { | |||||
@Size(max = 255, message = "名称长度不能超过255") | |||||
private String realName; | |||||
@Size(max = 255, message = "头像长度不能超过255") | |||||
private String path; | |||||
} |
@@ -0,0 +1,55 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.User; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
import javax.validation.constraints.Pattern; | |||||
import javax.validation.constraints.Size; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 用户中心修改DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class UserCenterUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = -6196691710092809498L; | |||||
@NotNull(groups = User.Update.class) | |||||
private Long id; | |||||
@ApiModelProperty(value = "用户昵称") | |||||
@NotBlank(message = "用户昵称不能为空") | |||||
@Size(max = 255, message = "昵称长度不能超过255") | |||||
private String nickName; | |||||
@ApiModelProperty(value = "性别") | |||||
private String sex; | |||||
@NotBlank | |||||
@Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$", message = "手机号格式有误") | |||||
private String phone; | |||||
private String remark; | |||||
} |
@@ -0,0 +1,84 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Role; | |||||
import org.dubhe.admin.domain.entity.UserAvatar; | |||||
import javax.validation.constraints.*; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
import java.util.List; | |||||
/** | |||||
* @description 用户创建DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class UserCreateDTO implements Serializable { | |||||
private static final long serialVersionUID = -6196691710092809498L; | |||||
@NotBlank | |||||
@Size(max = 255, message = "名称长度不能超过255") | |||||
private String username; | |||||
/** | |||||
* 用户昵称 | |||||
*/ | |||||
@NotBlank | |||||
@Size(max = 255, message = "昵称长度不能超过255") | |||||
private String nickName; | |||||
/** | |||||
* 性别 | |||||
*/ | |||||
private String sex; | |||||
@NotBlank | |||||
@Pattern(regexp = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message = "邮箱地址格式有误") | |||||
private String email; | |||||
@NotBlank | |||||
@Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$", message = "手机号格式有误") | |||||
private String phone; | |||||
@NotNull | |||||
private Boolean enabled; | |||||
private String password; | |||||
private Date lastPasswordResetTime; | |||||
@Size(max = 255, message = "昵称长度不能超过255") | |||||
private String remark; | |||||
private Long avatarId; | |||||
private UserAvatar userAvatar; | |||||
@NotEmpty | |||||
private List<Role> roles; | |||||
private Boolean deleted; | |||||
} |
@@ -0,0 +1,40 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 用户删除 dto | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class UserDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "用户id集合") | |||||
@NotEmpty | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,62 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import javax.validation.constraints.Pattern; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 用户邮箱修改信息 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
@NoArgsConstructor | |||||
@AllArgsConstructor | |||||
@ApiModel(value = "邮箱修改请求实体", description = "邮箱修改请求实体") | |||||
public class UserEmailUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = -5997222212073811466L; | |||||
@NotNull(message = "用户ID不能为空") | |||||
@ApiModelProperty(value = "用户ID", name = "userId", example = "1") | |||||
private Long userId; | |||||
@Pattern(regexp = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message = "邮箱地址格式有误") | |||||
@NotEmpty(message = "邮箱地址不能为空") | |||||
@ApiModelProperty(value = "邮箱地址", name = "email", example = "xx@163.com") | |||||
private String email; | |||||
@NotNull(message = "密码不能为空") | |||||
@ApiModelProperty(value = "密码", name = "password", example = "123456") | |||||
private String password; | |||||
@NotNull(message = "激活码不能为空") | |||||
@ApiModelProperty(value = "激活码", name = "code", example = "998877") | |||||
private String code; | |||||
} |
@@ -0,0 +1,50 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.NotBlank; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 新增用户组实体DTO | |||||
* @date 2021-05-08 | |||||
*/ | |||||
@Data | |||||
public class UserGroupDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "用户组id") | |||||
private Long id; | |||||
@ApiModelProperty(value = "用户组名称") | |||||
@NotBlank(message = "用户组名称不能为空") | |||||
@Length(max = 32, message = "名称长度不能超过32") | |||||
private String name; | |||||
@ApiModelProperty("用户组描述") | |||||
@Length(max = 255, message = "描述长度不能超过255") | |||||
private String description; | |||||
@ApiModelProperty(value = "用户id集合") | |||||
private Set<Long> userIds; | |||||
} |
@@ -0,0 +1,36 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 删除用户组DTO | |||||
* @date 2021-05-11 | |||||
*/ | |||||
@Data | |||||
public class UserGroupDeleteDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@NotNull(message = "用户组id不能为空") | |||||
private Set<Long> ids; | |||||
} |
@@ -0,0 +1,41 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
import org.dubhe.biz.db.base.PageQueryBase; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 获取用户组信息 | |||||
* @date 2021-05-06 | |||||
*/ | |||||
@Data | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode | |||||
public class UserGroupQueryDTO extends PageQueryBase implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "用户组id或名称") | |||||
private String keyword; | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 用户组成员操作DTO | |||||
* @date 2021-05-11 | |||||
*/ | |||||
@Data | |||||
public class UserGroupUpdDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "用户组id") | |||||
@NotNull(message = "用户组id不能为空") | |||||
private Long groupId; | |||||
@ApiModelProperty(value = "用户id集合") | |||||
private Set<Long> userIds; | |||||
@ApiModelProperty(value = "角色id集合") | |||||
private Set<Long> roleIds; | |||||
} |
@@ -0,0 +1,36 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.Size; | |||||
/** | |||||
* @description 修改密码的 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class UserPassUpdateDTO { | |||||
@Size(max = 255, message = "密码长度不能超过255") | |||||
private String oldPass; | |||||
@Size(max = 255, message = "密码长度不能超过255") | |||||
private String newPass; | |||||
} |
@@ -0,0 +1,53 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.annotation.Query; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 用户查询DTO | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
public class UserQueryDTO implements Serializable { | |||||
private static final long serialVersionUID = -6863842533017963450L; | |||||
@Query | |||||
private Long id; | |||||
@Query(blurry = "email,username,nick_name") | |||||
private String blurry; | |||||
@Query | |||||
private Boolean enabled; | |||||
@Query(propName = "deleted", type = Query.Type.EQ) | |||||
private Boolean deleted = false; | |||||
private Long roleId; | |||||
@Query(propName = "create_time", type = Query.Type.BETWEEN) | |||||
private List<Timestamp> createTime; | |||||
} |
@@ -0,0 +1,72 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import javax.validation.constraints.Pattern; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 用户注册请求实体 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@ApiModel(value = "用户注册请求实体", description = "用户注册请求实体") | |||||
public class UserRegisterDTO implements Serializable { | |||||
private static final long serialVersionUID = -7351676930575145394L; | |||||
@ApiModelProperty(value = "账号", name = "username", example = "test") | |||||
@NotEmpty(message = "账号不能为空") | |||||
private String username; | |||||
@ApiModelProperty(value = "昵称", name = "nickName", example = "xt") | |||||
private String nickName; | |||||
@ApiModelProperty(value = "性别", name = "sex", example = "1") | |||||
private Integer sex; | |||||
@NotEmpty(message = "邮箱地址不能为空") | |||||
@Pattern(regexp = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message = "邮箱地址格式有误") | |||||
@ApiModelProperty(value = "邮箱地址", name = "email", example = "xxx@163.com") | |||||
private String email; | |||||
@NotNull(message = "手机号不能为空") | |||||
@Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$", message = "手机号格式有误") | |||||
@ApiModelProperty(value = "手机号", name = "phone", example = "13823370116") | |||||
private String phone; | |||||
@NotNull(message = "密码不能为空") | |||||
@ApiModelProperty(value = "密码", name = "password", example = "123456") | |||||
private String password; | |||||
@NotNull(message = "激活码不能为空") | |||||
@ApiModelProperty(value = "激活码", name = "code", example = "998877") | |||||
private String code; | |||||
} |
@@ -0,0 +1,51 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import javax.validation.constraints.Pattern; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 用户注册邮箱请求实体 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@ApiModel(value = "发送邮箱验证码请求实体", description = "发送邮箱验证码请求实体") | |||||
public class UserRegisterMailDTO implements Serializable { | |||||
private static final long serialVersionUID = 5063855150803214253L; | |||||
@NotNull(message = "类型不能为空") | |||||
@ApiModelProperty(value = "类型 1 用户注册 2 修改邮箱 3 其他 4 忘记密码", name = "type", example = "1") | |||||
private Integer type; | |||||
@NotEmpty(message = "邮箱地址不能为空") | |||||
@Pattern(regexp = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message = "邮箱地址格式有误") | |||||
@ApiModelProperty(value = "邮箱地址", name = "email", example = "xxx@163.com") | |||||
private String email; | |||||
} |
@@ -0,0 +1,57 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import javax.validation.constraints.NotEmpty; | |||||
import javax.validation.constraints.NotNull; | |||||
import javax.validation.constraints.Pattern; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 用户重置密码请求实体 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@ApiModel(value = "用户重置密码请求实体", description = "用户重置密码请求实体") | |||||
public class UserResetPasswordDTO implements Serializable { | |||||
private static final long serialVersionUID = -4249894291904235207L; | |||||
@NotEmpty(message = "邮箱地址不能为空") | |||||
@Pattern(regexp = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message = "邮箱地址格式有误") | |||||
@ApiModelProperty(value = "邮箱地址", name = "email", example = "xxx@163.com") | |||||
private String email; | |||||
@NotNull(message = "密码不能为空") | |||||
@ApiModelProperty(value = "密码", name = "password", example = "123456") | |||||
private String password; | |||||
@NotNull(message = "激活码不能为空") | |||||
@ApiModelProperty(value = "激活码", name = "code", example = "998877") | |||||
private String code; | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.util.Set; | |||||
/** | |||||
* @description 批量修改用户组用户的角色 | |||||
* @date 2021-05-12 | |||||
*/ | |||||
@Data | |||||
public class UserRoleUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value = "用户组id") | |||||
@NotNull(message = "用户组id不能为空") | |||||
private Long groupId; | |||||
@ApiModelProperty("角色id集合") | |||||
@NotNull(message = "角色id不能为空") | |||||
private Set<Long> roleIds; | |||||
} |
@@ -0,0 +1,40 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 批量修改用户组用户状态DTO | |||||
* @date 2021-05-12 | |||||
*/ | |||||
@Data | |||||
public class UserStateUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty(value ="用户组id" ) | |||||
@NotNull(message = "用户组id不能为空") | |||||
private Long groupId; | |||||
@ApiModelProperty("用户状态:激活:true,锁定:false") | |||||
private boolean enabled; | |||||
} |
@@ -0,0 +1,86 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.dto; | |||||
import lombok.Data; | |||||
import org.dubhe.admin.domain.entity.Role; | |||||
import org.dubhe.admin.domain.entity.User; | |||||
import org.dubhe.admin.domain.entity.UserAvatar; | |||||
import javax.validation.constraints.*; | |||||
import java.io.Serializable; | |||||
import java.util.Date; | |||||
import java.util.List; | |||||
/** | |||||
* @description 用户修改DTO | |||||
* @date 2020-06-29 | |||||
*/ | |||||
@Data | |||||
public class UserUpdateDTO implements Serializable { | |||||
private static final long serialVersionUID = -6196691710092809498L; | |||||
@NotNull(groups = User.Update.class) | |||||
private Long id; | |||||
@NotBlank | |||||
@Size(max = 255, message = "名称长度不能超过255") | |||||
private String username; | |||||
/** | |||||
* 用户昵称 | |||||
*/ | |||||
@NotBlank | |||||
@Size(max = 255, message = "昵称长度不能超过255") | |||||
private String nickName; | |||||
/** | |||||
* 性别 | |||||
*/ | |||||
private String sex; | |||||
@NotBlank | |||||
@Pattern(regexp = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", message = "邮箱地址格式有误") | |||||
private String email; | |||||
@NotBlank | |||||
@Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$", message = "手机号格式有误") | |||||
private String phone; | |||||
@NotNull | |||||
private Boolean enabled; | |||||
private String password; | |||||
private Date lastPasswordResetTime; | |||||
@Size(max = 255, message = "昵称长度不能超过255") | |||||
private String remark; | |||||
private Long avatarId; | |||||
private UserAvatar userAvatar; | |||||
@NotEmpty | |||||
private List<Role> roles; | |||||
private Boolean deleted; | |||||
} |
@@ -0,0 +1,43 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.Data; | |||||
import org.dubhe.biz.db.entity.BaseEntity; | |||||
/** | |||||
* @description 权限组实体类 | |||||
* @date 2021-05-14 | |||||
*/ | |||||
@Data | |||||
@TableName("auth") | |||||
public class Auth extends BaseEntity { | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@TableField(value = "auth_code") | |||||
private String authCode; | |||||
@TableField(value = "description") | |||||
private String description; | |||||
} |
@@ -0,0 +1,45 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description | |||||
* @date 2021-05-14 | |||||
*/ | |||||
@Data | |||||
@TableName("auth_permission") | |||||
public class AuthPermission implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/** | |||||
* 权限组id | |||||
*/ | |||||
@TableField(value = "auth_id") | |||||
private Long authId; | |||||
/** | |||||
* 权限id | |||||
*/ | |||||
@TableField(value = "permission_id") | |||||
private Long permissionId; | |||||
} |
@@ -0,0 +1,45 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.Data; | |||||
/** | |||||
* @description 序列表 | |||||
* @date 2020-09-23 | |||||
*/ | |||||
@Data | |||||
@TableName("data_sequence") | |||||
public class DataSequence { | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@TableField(value = "business_code") | |||||
private String businessCode; | |||||
@TableField(value = "start") | |||||
private Long start; | |||||
@TableField(value = "step") | |||||
private Long step; | |||||
} |
@@ -0,0 +1,75 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
import java.util.List; | |||||
/** | |||||
* @description 字典实体 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@TableName("dict") | |||||
@Builder | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public class Dict implements Serializable { | |||||
private static final long serialVersionUID = -3995510721958462699L; | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
@NotNull(groups = Update.class) | |||||
private Long id; | |||||
/** | |||||
* 名称 | |||||
*/ | |||||
@TableField(value = "name") | |||||
@NotBlank | |||||
@Length(max = 255, message = "名称长度不能超过255") | |||||
private String name; | |||||
/** | |||||
* 备注 | |||||
*/ | |||||
@TableField(value = "remark") | |||||
@Length(max = 255, message = "备注长度不能超过255") | |||||
private String remark; | |||||
@TableField(value = "create_time") | |||||
private Timestamp createTime; | |||||
@TableField(exist = false) | |||||
private List<org.dubhe.admin.domain.entity.DictDetail> dictDetails; | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,77 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.NotNull; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
/** | |||||
* @description 字典详情实体 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@TableName("dict_detail") | |||||
@Builder | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
public class DictDetail implements Serializable { | |||||
private static final long serialVersionUID = 299242717738411209L; | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
@NotNull(groups = Update.class) | |||||
private Long id; | |||||
/** | |||||
* 字典标签 | |||||
*/ | |||||
@TableField(value = "label") | |||||
@Length(max = 255, message = "字典标签长度不能超过255") | |||||
private String label; | |||||
/** | |||||
* 字典值 | |||||
*/ | |||||
@TableField(value = "value") | |||||
@Length(max = 255, message = "字典值长度不能超过255") | |||||
private String value; | |||||
/** | |||||
* 排序 | |||||
*/ | |||||
@TableField(value = "sort") | |||||
private String sort = "999"; | |||||
@TableField(value = "dict_id") | |||||
private Long dictId; | |||||
@TableField(value = "create_time") | |||||
private Timestamp createTime; | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,46 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import org.dubhe.biz.db.entity.BaseEntity; | |||||
/** | |||||
* @description 用户组实体类 | |||||
* @date 2021-05-06 | |||||
*/ | |||||
@Data | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@TableName("pt_group") | |||||
public class Group extends BaseEntity { | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@TableField(value = "name") | |||||
private String name; | |||||
@TableField(value = "description") | |||||
private String description; | |||||
} |
@@ -0,0 +1,106 @@ | |||||
/** | |||||
* Copyright 2019-2020 Zheng Jie | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import java.io.Serializable; | |||||
import java.sql.Timestamp; | |||||
/** | |||||
* @description 日志实体 | |||||
* @date 2020-06-01 | |||||
*/ | |||||
@Data | |||||
@TableName("log") | |||||
@NoArgsConstructor | |||||
public class Log implements Serializable { | |||||
private static final long serialVersionUID = -4447644691937249474L; | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
/** | |||||
* 操作用户 | |||||
*/ | |||||
@TableField(value = "username") | |||||
private String username; | |||||
/** | |||||
* 描述 | |||||
*/ | |||||
@TableField(value = "description") | |||||
private String description; | |||||
/** | |||||
* 方法名 | |||||
*/ | |||||
@TableField(value = "label") | |||||
private String method; | |||||
/** | |||||
* 参数 | |||||
*/ | |||||
@TableField(value = "text") | |||||
private String params; | |||||
/** | |||||
* 日志类型 | |||||
*/ | |||||
@TableField(value = "log_type") | |||||
private String logType; | |||||
/** | |||||
* 请求ip | |||||
*/ | |||||
@TableField(value = "request_ip") | |||||
private String requestIp; | |||||
/** | |||||
* 浏览器 | |||||
*/ | |||||
@TableField(value = "browser") | |||||
private String browser; | |||||
/** | |||||
* 请求耗时 | |||||
*/ | |||||
@TableField(value = "time") | |||||
private Long time; | |||||
/** | |||||
* 异常详细 | |||||
*/ | |||||
@TableField(value = "exception_detail") | |||||
private byte[] exceptionDetail; | |||||
/** | |||||
* 创建日期 | |||||
*/ | |||||
@TableField(value = "create_time") | |||||
private Timestamp createTime; | |||||
public Log(String logType, Long time) { | |||||
this.logType = logType; | |||||
this.time = time; | |||||
} | |||||
} |
@@ -0,0 +1,109 @@ | |||||
/** | |||||
* Copyright 2019-2020 Zheng Jie | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.*; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Builder; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import org.dubhe.biz.db.entity.BaseEntity; | |||||
import java.io.Serializable; | |||||
/** | |||||
* @description 菜单实体 | |||||
* @date 2020-11-30 | |||||
*/ | |||||
@Data | |||||
@Builder | |||||
@AllArgsConstructor | |||||
@NoArgsConstructor | |||||
@TableName("menu") | |||||
public class Menu extends BaseEntity implements Serializable { | |||||
private static final long serialVersionUID = 3100515433018008777L; | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
private String name; | |||||
@TableField(value = "sort") | |||||
private Long sort = 999L; | |||||
@TableField(value = "path") | |||||
private String path; | |||||
@TableField(value = "component") | |||||
private String component; | |||||
/** | |||||
* 类型,目录、菜单、按钮 | |||||
*/ | |||||
@TableField(value = "type") | |||||
private Integer type; | |||||
/** | |||||
* 权限 | |||||
*/ | |||||
@TableField(value = "permission") | |||||
private String permission; | |||||
@TableField(value = "component_name") | |||||
private String componentName; | |||||
@TableField(value = "icon") | |||||
private String icon; | |||||
/** | |||||
* 布局类型 | |||||
*/ | |||||
@TableField(value = "layout") | |||||
private String layout; | |||||
@TableField(value = "cache") | |||||
private Boolean cache; | |||||
@TableField(value = "hidden") | |||||
private Boolean hidden; | |||||
/** | |||||
* 上级菜单ID | |||||
*/ | |||||
@TableField(value = "pid") | |||||
private Long pid; | |||||
@TableField(value = "deleted",fill = FieldFill.INSERT) | |||||
private Boolean deleted; | |||||
/** | |||||
* 回到上一级 | |||||
*/ | |||||
@TableField(updateStrategy = FieldStrategy.IGNORED) | |||||
private String backTo; | |||||
/** | |||||
* 扩展配置 | |||||
*/ | |||||
@TableField(updateStrategy = FieldStrategy.IGNORED) | |||||
private String extConfig; | |||||
public @interface Update { | |||||
} | |||||
} |
@@ -0,0 +1,48 @@ | |||||
/** | |||||
* Copyright 2020 Tianshu AI Platform. All Rights Reserved. | |||||
* | |||||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||||
* you may not use this file except in compliance with the License. | |||||
* You may obtain a copy of the License at | |||||
* | |||||
* http://www.apache.org/licenses/LICENSE-2.0 | |||||
* | |||||
* Unless required by applicable law or agreed to in writing, software | |||||
* distributed under the License is distributed on an "AS IS" BASIS, | |||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
* See the License for the specific language governing permissions and | |||||
* limitations under the License. | |||||
* ============================================================= | |||||
*/ | |||||
package org.dubhe.admin.domain.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableField; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.Data; | |||||
import lombok.experimental.Accessors; | |||||
import org.dubhe.biz.db.entity.BaseEntity; | |||||
/** | |||||
* @description | |||||
* @date 2021-04-26 | |||||
*/ | |||||
@Data | |||||
@TableName("permission") | |||||
@Accessors(chain = true) | |||||
public class Permission extends BaseEntity { | |||||
@TableId(value = "id", type = IdType.AUTO) | |||||
private Long id; | |||||
@TableId(value = "pid") | |||||
private Long pid; | |||||
@TableField(value = "name") | |||||
private String name; | |||||
@TableField(value = "permission") | |||||
private String permission; | |||||
} |